[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 42/66] i386/i386at/lpr.c: remove uninitialized variable
From: |
Marin Ramesa |
Subject: |
[PATCH 42/66] i386/i386at/lpr.c: remove uninitialized variable |
Date: |
Thu, 5 Dec 2013 22:03:36 +0100 |
Variable lpr_alive is never initialized. I suggest a removal of
the code that deals with this variable.
But, on the other hand, maybe the variable should be initialized
to all zero.
It's not so clear from the code.
* i386/i386at/lpr.c (lpr_alive): Remove variable.
Remove the if.
---
i386/i386at/lpr.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 557eb15..e580da9 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -67,8 +67,6 @@ struct bus_driver lprdriver = {
struct tty lpr_tty[NLPR];
-int lpr_alive[NLPR];
-
int
lprprobe(port, dev)
struct bus_device *dev;
@@ -85,14 +83,7 @@ struct bus_device *dev;
outb(INTR_ENAB(addr),0x07);
outb(DATA(addr),0xaa);
ret = inb(DATA(addr)) == 0xaa;
- if (ret) {
- if (lpr_alive[unit]) {
- printf("lpr: Multiple alive entries for unit %d.\n",
unit);
- printf("lpr: Ignoring entry with address = %x .\n",
addr);
- ret = 0;
- } else
- lpr_alive[unit]++;
- }
+
return(ret);
}
--
1.8.1.4
- Re: [PATCH 31/66] i386/i386at/com.c: simplify code, (continued)
- [PATCH 32/66] i386/i386at/com.c: remove dead assignment, Marin Ramesa, 2013/12/05
- [PATCH 33/66] i386/i386at/immc.c, kd.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 34/66] i386/i386at/model_dep.c, kd.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 40/66] i386/i386at/kd.h: remove ifdef, Marin Ramesa, 2013/12/05
- [PATCH 41/66] i386/i386at/kd.h: remove ifdef, Marin Ramesa, 2013/12/05
- [PATCH 43/66] i386/i386at/rtc.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 42/66] i386/i386at/lpr.c: remove uninitialized variable,
Marin Ramesa <=
- [PATCH 44/66] i386/i386at/rtc.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 45/66] i386/intel/pmap.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 47/66] ipc/ipc_init.c: qualify constant with const, Marin Ramesa, 2013/12/05
- [PATCH 46/66] i386/intel/pmap.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 48/66] ipc/mach_port.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 49/66] ipc/port.h: update comment, Marin Ramesa, 2013/12/05
- [PATCH 50/66] kern/act.c, act.h: comment unused variable, Marin Ramesa, 2013/12/05
- [PATCH 51/66] kern/act.h: remove prototype without definition, Marin Ramesa, 2013/12/05