NetBSD Problem Report #38564

From woods@once.weird.com  Fri May  2 16:34:07 2008
Return-Path: <woods@once.weird.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9FF8F63BA2C
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 May 2008 16:34:06 +0000 (UTC)
Message-Id: <m1JryCw-0018KZC@once.weird.com>
Date: Fri, 2 May 2008 12:34:02 -0400 (EDT)
From: "Greg A. Woods" <woods@planix.com>
Sender: "Greg A. Woods" <woods@once.weird.com>
Reply-To: "Greg A. Woods" <woods@planix.com>
To: gnats-bugs@gnats.NetBSD.org
Subject: comcnpollc() is unnecessary
X-Send-Pr-Version: 3.95

>Number:         38564
>Category:       kern
>Synopsis:       comcnpollc() is unnecessary
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 02 16:35:00 +0000 2008
>Closed-Date:    Sat Dec 31 04:03:51 +0000 2022
>Last-Modified:  Sat Dec 31 04:03:51 +0000 2022
>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 */

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 31 Dec 2022 04:03:51 +0000
State-Changed-Why:
No idea what the history is, but comcnpollc in sys/dev/ic/com.c is
no longer empty.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.