From nobody@FreeBSD.org  Thu Mar 16 20:35:58 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21])
	by hub.freebsd.org (Postfix) with ESMTP id C323B37B608
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Mar 2000 20:35:58 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.9.3/8.9.2) id UAA32029;
	Thu, 16 Mar 2000 20:35:58 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Message-Id: <200003170435.UAA32029@freefall.freebsd.org>
Date: Thu, 16 Mar 2000 20:35:58 -0800 (PST)
From: spock@techfour.net
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] fix two small printing errors in ppbus
X-Send-Pr-Version: www-1.0

>Number:         17425
>Category:       kern
>Synopsis:       [ppbus] [patch] fix two small printing errors in ppbus
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 16 20:40:04 PST 2000
>Closed-Date:    Tue Nov 13 20:48:47 UTC 2012
>Last-Modified:  Tue Nov 13 20:48:47 UTC 2012
>Originator:     Mike Heffner
>Release:        5.0-current
>Organization:
>Environment:
FreeBSD 5.0-CURRENT #2: Thu Mar 16 23:15:16 EST 2000
>Description:
First fix, the following line:
ppbus0: IEEE1284 device found /NIBBLE
shouldn't include '/' if not needed (ie. only one mode detected).

Second fix, when searching for the 'class' token in the ppb PNP string, 
we should test for "CLASS", in addition to "CLS" (already present). 
>How-To-Repeat:
N/A
>Fix:
The following patch fixes both items, sorry for any whitespace problems.


Index: ppbconf.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ppbus/ppbconf.c,v
retrieving revision 1.17
diff -u -r1.17 ppbconf.c
--- ppbconf.c	2000/01/23 14:41:04	1.17
+++ ppbconf.c	2000/03/17 04:34:19
@@ -262,7 +262,8 @@
 
 	printf(">");
 
-	if ((token = search_token(str, len, "CLS")) != NULL) {
+	if ((token = search_token(str, len, "CLS")) != NULL ||
+	    (token = search_token(str, len, "CLASS")) != NULL) {
 		class = search_token(token, UNKNOWN_LENGTH, ":") + 1;
 		printf(" %s", class);
 	}
@@ -300,6 +301,7 @@
 	struct ppb_data * ppb = (struct ppb_data *)device_get_softc(bus);
 	int error = 0;
 	int unit = device_get_unit(bus);
+	short int nmodes = 0;
 
 	/* try all IEEE1284 modes, for one device only
 	 * 
@@ -317,27 +319,27 @@
 	printf("ppbus%d: IEEE1284 device found ", unit);
 
 	if (!(error = ppb_1284_negociate(bus, PPB_NIBBLE, 0))) {
-		printf("/NIBBLE");
+		printf("%sNIBBLE", nmodes++ ? "/" : "");
 		ppb_1284_terminate(bus);
 	}
 
 	if (!(error = ppb_1284_negociate(bus, PPB_PS2, 0))) {
-		printf("/PS2");
+		printf("%sPS2", nmodes++ ? "/" : "");
 		ppb_1284_terminate(bus);
 	}
 
 	if (!(error = ppb_1284_negociate(bus, PPB_ECP, 0))) {
-		printf("/ECP");
+		printf("%sECP", nmodes++ ? "/" : "");
 		ppb_1284_terminate(bus);
 	}
 
 	if (!(error = ppb_1284_negociate(bus, PPB_ECP, PPB_USE_RLE))) {
-		printf("/ECP_RLE");
+		printf("%sECP_RLE", nmodes++ ? "/" : "");
 		ppb_1284_terminate(bus);
 	}
 
 	if (!(error = ppb_1284_negociate(bus, PPB_EPP, 0))) {
-		printf("/EPP");
+		printf("%sEPP", nmodes++ ? "/" : "");
 		ppb_1284_terminate(bus);
 	}
 
@@ -345,31 +347,31 @@
 	if (bootverbose) {
 		if (!(error = ppb_1284_negociate(bus, PPB_NIBBLE,
 				PPB_REQUEST_ID))) {
-			printf("/NIBBLE_ID");
+			printf("%sNIBBLE_ID", nmodes++ ? "/" : "");
 			ppb_1284_terminate(bus);
 		}
 
 		if (!(error = ppb_1284_negociate(bus, PPB_PS2,
 				PPB_REQUEST_ID))) {
-			printf("/PS2_ID");
+			printf("%sPS2_ID", nmodes++ ? "/" : "");
 			ppb_1284_terminate(bus);
 		}
 
 		if (!(error = ppb_1284_negociate(bus, PPB_ECP,
 				PPB_REQUEST_ID))) {
-			printf("/ECP_ID");
+			printf("%sECP_ID", nmodes++ ? "/" : "");
 			ppb_1284_terminate(bus);
 		}
 
 		if (!(error = ppb_1284_negociate(bus, PPB_ECP,
 				PPB_REQUEST_ID | PPB_USE_RLE))) {
-			printf("/ECP_RLE_ID");
+			printf("%sECP_RLE_ID", nmodes++ ? "/" : "");
 			ppb_1284_terminate(bus);
 		}
 
 		if (!(error = ppb_1284_negociate(bus, PPB_COMPATIBLE,
 				PPB_EXTENSIBILITY_LINK))) {
-			printf("/Extensibility Link");
+			printf("%sExtensibility Link", nmodes++ ? "/" : "");
 			ppb_1284_terminate(bus);
 		}
 	}

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->nsouch  
Responsible-Changed-By: cpiazza 
Responsible-Changed-When: Fri Mar 17 20:18:54 PST 2000 
Responsible-Changed-Why:  
Over to maintainer 
Responsible-Changed-From-To: nsouch->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jul 24 15:54:18 GMT 2005 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=17425 

The message _should_ have said:

Assignee has agreed that this PR should be reassigned to the pool
due to inactivity.
State-Changed-From-To: open->feedback 
State-Changed-By: eadler 
State-Changed-When: Thu Sep 1 22:19:02 UTC 2011 
State-Changed-Why:  
Hunk #2 of this patch no longer applies, is this still a bug and if so 
can you please provide an updated patch? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17425 
State-Changed-From-To: feedback->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Nov 13 20:48:46 UTC 2012 
State-Changed-Why:  
Feedback timeout. Please email me and I will reopen if needed. 

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