NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/44665: spdmem debug output is a bit mangled



>Number:         44665
>Category:       kern
>Synopsis:       spdmem debug output is a bit mangled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 02 12:50:00 +0000 2011
>Originator:     Jasper Wallace
>Release:        -current
>Organization:
Pointless.net
>Environment:
NetBSD monstrosity 5.99.45 NetBSD 5.99.45 (MONSTROSITY) #19: Wed Mar  2 
12:42:56 GMT 2011  
jasper@limpit:/home/jasper/develop/netbsd/netbsd-src-and-build/tree/l.64/obj/sys/arch/amd64/compile/MONSTROSITY
 amd64
>Description:
The debug output of spdmem calculates the length of hex to print wrong so it 
prints too much repeatedly.

>How-To-Repeat:
compile a kernel with spdmem at iic and DEBUG and look at the spdmem dmesg 
output.

>Fix:
Index: spdmem.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/spdmem.c,v
retrieving revision 1.2
diff -u -u -r1.2 spdmem.c
--- spdmem.c    29 Jun 2010 04:42:30 -0000      1.2
+++ spdmem.c    2 Mar 2011 10:09:20 -0000
@@ -265,7 +265,7 @@
                int j, k;
                aprint_debug("\n");
                aprint_debug_dev(self, "0x%02x:", i);
-               k = (spd_len > i + 16) ? spd_len : i + 16;
+               k = (spd_len > (i + 16)) ? i + 16 : spd_len;
                for (j = i; j < k; j++)
                        aprint_debug(" %02x", ((uint8_t *)s)[j]);
        }



Home | Main Index | Thread Index | Old Index