NetBSD-Bugs archive

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

kern/38564: comcnpollc() is unnecessary



>Number:         38564
>Category:       kern
>Synopsis:       comcnpollc() is unnecessary
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 02 16:35:00 +0000 2008
>Originator:     Greg A. Woods
>Release:        NetBSD current 2008/05/02
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:

        there's an empty function called comcnpollc() which does nothing
        and which can and should be replaced in all usages with nullcnpollc()

>How-To-Repeat:

        try to track down how serial console polling works and notice
        the empty function definition

>Fix:

        I think this is the whole fix, based on reading and searching
        the source, though I can't claim to have built kernels for very
        many architectures....

Index: sys/dev/pci/puccn.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/sys/dev/pci/puccn.c,v
retrieving revision 1.9
diff -u -r1.9 puccn.c
--- sys/dev/pci/puccn.c 13 Jan 2007 18:59:31 -0000      1.9
+++ sys/dev/pci/puccn.c 21 Mar 2008 22:33:55 -0000
@@ -83,6 +83,7 @@
 }
 #endif
 
+#define comcnpollc     nullcnpollc
 cons_decl(com);
 
 static bus_addr_t puccnbase;
@@ -222,4 +223,4 @@
            CONMODE);
 }
 
-/* comcngetc, comcnputc, comcnpollc provided by dev/ic/com.c */
+/* comcngetc() and comcnputc() are provided by dev/ic/com.c */
Index: sys/dev/ic/com.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/sys/dev/ic/com.c,v
retrieving revision 1.281
diff -u -r1.281 com.c
--- sys/dev/ic/com.c    28 Apr 2008 22:00:01 -0000      1.281
+++ sys/dev/ic/com.c    29 Apr 2008 16:27:23 -0000
@@ -179,7 +179,6 @@
 
 int    comcngetc(dev_t);
 void   comcnputc(dev_t, int);
-void   comcnpollc(dev_t, int);
 
 #define        integrate       static inline
 void   comsoft(void *);
@@ -2212,7 +2211,7 @@
  * Following are all routines needed for COM to act as console
  */
 struct consdev comcons = {
-       NULL, NULL, comcngetc, comcnputc, comcnpollc, NULL, NULL, NULL,
+       NULL, NULL, comcngetc, comcnputc, nullcnpollc, NULL, NULL, NULL,
        NODEV, CN_NORMAL
 };
 
@@ -2273,12 +2272,6 @@
        com_common_putc(dev, &comconsregs, c);
 }
 
-void
-comcnpollc(dev_t dev, int on)
-{
-
-}
-
 #ifdef KGDB
 int
 com_kgdb_attach1(struct com_regs *regsp, int rate, int frequency, int type,
Index: sys/arch/hpcsh/hpcsh/console.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/sys/arch/hpcsh/hpcsh/console.c,v
retrieving revision 1.14
diff -u -r1.14 console.c
--- sys/arch/hpcsh/hpcsh/console.c      28 Apr 2008 20:23:22 -0000      1.14
+++ sys/arch/hpcsh/hpcsh/console.c      29 Apr 2008 16:26:40 -0000
@@ -64,11 +64,11 @@
 cons_decl(scif);
 #define        hd64461uartcnputc       comcnputc
 #define        hd64461uartcngetc       comcngetc
-#define        hd64461uartcnpollc      comcnpollc
+#define        hd64461uartcnpollc      nullcnpollc
 cons_decl(hd64461uart);
 #define        hd64465uartcnputc       comcnputc
 #define        hd64465uartcngetc       comcngetc
-#define        hd64465uartcnpollc      comcnpollc
+#define        hd64465uartcnpollc      nullcnpollc
 cons_decl(hd64465uart);
 
 /* Builtin video console */



Home | Main Index | Thread Index | Old Index