From jeremyp@gsmx07.alcatel.com.au  Tue Feb 26 13:31:13 2002
Return-Path: <jeremyp@gsmx07.alcatel.com.au>
Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27])
	by hub.freebsd.org (Postfix) with ESMTP id 07ADF37B434
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Feb 2002 13:31:06 -0800 (PST)
Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1])
	by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id IAA21318
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Feb 2002 08:31:04 +1100 (EDT)
Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au
 (PMDF V5.2-32 #37641) with ESMTP id <01KERGDQUIAOVFP6MT@cim.alcatel.com.au>
 for FreeBSD-gnats-submit@freebsd.org; Wed, 27 Feb 2002 08:31:00 +1100
Received: (from jeremyp@localhost)	by gsmx07.alcatel.com.au (8.11.6/8.11.6)
 id g1QLV1r27426; Wed, 27 Feb 2002 08:31:01 +1100 (EST envelope-from jeremyp)
Message-Id: <200202262131.g1QLV1r27426@gsmx07.alcatel.com.au>
Date: Wed, 27 Feb 2002 08:31:01 +1100 (EST)
From: Peter Jeremy <peter.jeremy@alcatel.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Dead code uhci_reset() in /sys/dev/usb/uhci.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35356
>Category:       kern
>Synopsis:       Dead code uhci_reset() in /sys/dev/usb/uhci.c
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    joe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 26 13:40:01 PST 2002
>Closed-Date:    Thu Mar 28 03:52:38 PST 2002
>Last-Modified:  Thu Mar 28 03:52:38 PST 2002
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:
System: FreeBSD gsmx07.alcatel.com.au 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Jan 3 05:48:39 EST 2002 root@gsmx07.alcatel.com.au:/usr/obj/3.0/cvs/src/sys/gsmx i386

>Description:
	/sys/dev/usb/uhci.c defines an unused static function uhci_reset().
	
>How-To-Repeat:
	Try to build GENERIC with sys/conf/kern.pre.mk 1.8
>Fix:

Index: uhci.c
===================================================================
RCS file: /home/CVSROOT/src/sys/dev/usb/uhci.c,v
retrieving revision 1.82
diff -u -r1.82 uhci.c
--- uhci.c	16 Feb 2002 00:51:26 -0000	1.82
+++ uhci.c	26 Feb 2002 21:24:37 -0000
@@ -161,7 +161,6 @@
 Static LIST_HEAD(, uhci_intr_info) uhci_ii_free;
 
 Static void		uhci_busreset(uhci_softc_t *);
-Static void		uhci_reset(uhci_softc_t *);
 Static usbd_status	uhci_run(uhci_softc_t *, int run);
 Static uhci_soft_td_t  *uhci_alloc_std(uhci_softc_t *);
 Static void		uhci_free_std(uhci_softc_t *, uhci_soft_td_t *);
@@ -280,8 +279,6 @@
 #define UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd)
 #define UHCISTS(sc) UREAD2(sc, UHCI_STS)
 
-#define UHCI_RESET_TIMEOUT 100	/* ms, reset timeout */
-
 #define UHCI_CURFRAME(sc) (UREAD2(sc, UHCI_FRNUM) & UHCI_FRNUM_MASK)
 
 #define UHCI_INTR_ENDPT 1
@@ -1473,21 +1470,6 @@
 
 	if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT)
 		uhci_intr(sc);
-}
-
-void
-uhci_reset(uhci_softc_t *sc)
-{
-	int n;
-
-	UHCICMD(sc, UHCI_CMD_HCRESET);
-	/* The reset bit goes low when the controller is done. */
-	for (n = 0; n < UHCI_RESET_TIMEOUT &&
-		    (UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET); n++)
-		usb_delay_ms(&sc->sc_bus, 1);
-	if (n >= UHCI_RESET_TIMEOUT)
-		printf("%s: controller did not reset\n",
-		       USBDEVNAME(sc->sc_bus.bdev));
 }
 
 usbd_status
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joe 
Responsible-Changed-By: joe 
Responsible-Changed-When: Wed Feb 27 06:06:40 PST 2002 
Responsible-Changed-Why:  
I'm not sure whether this is dead code, or code that hasn't been 
used yet.  As you're aware I'm in the process of merging NetBSD's 
developments into our codebase.  It's possible that I've merged in stuff 
that's not being used yet. 
. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35356 
State-Changed-From-To: open->closed 
State-Changed-By: joe 
State-Changed-When: Thu Mar 28 03:52:16 PST 2002 
State-Changed-Why:  
I don't think that we need this PR anymore. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35356 
>Unformatted:
