Skip to content

Commit 0a6efc7

Browse files
error27davem330
authored andcommitted
arcnet: fix signed bug in probe function
probe_irq_off() returns the first irq found or if two irqs are found then it returns the negative of the first irq found. We can cast dev->irq to an int so that the test for negative values works. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8e64159 commit 0a6efc7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/arcnet/com20020-isa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ static int __init com20020isa_probe(struct net_device *dev)
9090
outb(0, _INTMASK);
9191
dev->irq = probe_irq_off(airqmask);
9292

93-
if (dev->irq <= 0) {
93+
if ((int)dev->irq <= 0) {
9494
BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed first time\n");
9595
airqmask = probe_irq_on();
9696
outb(NORXflag, _INTMASK);
9797
udelay(5);
9898
outb(0, _INTMASK);
9999
dev->irq = probe_irq_off(airqmask);
100-
if (dev->irq <= 0) {
100+
if ((int)dev->irq <= 0) {
101101
BUGMSG(D_NORMAL, "Autoprobe IRQ failed.\n");
102102
err = -ENODEV;
103103
goto out;

drivers/net/arcnet/com90io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int __init com90io_probe(struct net_device *dev)
213213
outb(0, _INTMASK);
214214
dev->irq = probe_irq_off(airqmask);
215215

216-
if (dev->irq <= 0) {
216+
if ((int)dev->irq <= 0) {
217217
BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed\n");
218218
goto err_out;
219219
}

0 commit comments

Comments
 (0)