From owner-freebsd-bugs Thu Mar 16 20:40:14 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0CA5737BCE6 for ; Thu, 16 Mar 2000 20:40:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA32338; Thu, 16 Mar 2000 20:40:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C323B37B608 for ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/17425: [PATCH] fix two small printing errors in ppbus Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17425 >Category: kern >Synopsis: [PATCH] fix two small printing errors in ppbus >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 16 20:40:04 PST 2000 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message