Skip to contentSkip to conversation

ARM: am79c961a: platform_get_irq() may return signed unnoticed

PATCH Applied Roel Kluin 4 participants 5 messages Apr 23, 2008 – Apr 29, 2008 Network drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ARM: am79c961a: platform_get_irq() may return signed unnoticed

dev->irq is unsigned, platform_get_irq() may return signed unnoticed

---

drivers/net/arm/am79c961a.c +7 -3
index ba6bd03..a637910 100644
@@ -693,11 +693,15 @@ static int __init am79c961_probe(struct platform_device *pdev)
 	 * done by the ether bootp loader.
 	 */
 	dev->base_addr = res->start;
-	dev->irq = platform_get_irq(pdev, 0);
+	ret = platform_get_irq(pdev, 0);
 
-	ret = -ENODEV;
-	if (dev->irq < 0)
+	if (ret < 0) {
+		ret = -ENODEV;
 		goto nodev;
+	}
+	dev->irq = ret;
+
+	ret = -ENODEV;
 	if (!request_region(dev->base_addr, 0x18, dev->name))
 		goto nodev;
 
author
#1 lore raw

PATCH 2/2 ARM: ax88796: platform_get_irq() may return signed unnoticed

similarly,
---
dev->irq is unsigned, platform_get_irq() may return signed unnoticed

---

drivers/net/ax88796.c +3 -3
index 194949a..26a735a 100644
@@ -838,10 +838,10 @@ static int ax_probe(struct platform_device *pdev)
 
 	/* find the platform resources */
 
-	dev->irq  = platform_get_irq(pdev, 0);
-	if (dev->irq < 0) {
+	ret  = platform_get_irq(pdev, 0);
+	dev->irq = ret;
+	if (ret < 0) {
 		dev_err(&pdev->dev, "no IRQ specified\n");
-		ret = -ENXIO;
 		goto exit_mem;
 	}
 
#3 lore raw
In reply to Roel Kluin

Hello,

Quoted 16 lines · Roel Kluin

dev->irq is unsigned, platform_get_irq() may return signed unnoticed

---

drivers/net/arm/am79c961a.c +1 -2
index ba6bd03..a637910 100644
@@ -693,11 +693,15 @@ static int __init am79c961_probe(struct platform_device *pdev)
 	 * done by the ether bootp loader.
 	 */
 	dev->base_addr = res->start;
-	dev->irq = platform_get_irq(pdev, 0);
+	ret = platform_get_irq(pdev, 0);
 
-	ret = -ENODEV;

drivers/net/arm/am79c961a.c static int __init am79c961_probe(struct platform_device *pdev) · line 706

Quoted 10 lines
drivers/net/arm/am79c961a.c +6 -1
-	if (dev->irq < 0)
+	if (ret < 0) {
+		ret = -ENODEV;
 		goto nodev;
+	}
+	dev->irq = ret;
+
+	ret = -ENODEV;
 	if (!request_region(dev->base_addr, 0x18, dev->name))
 		goto nodev;

For me the change looks fine.

Best regards
Uwe

Signature · 3 lines
Uwe Kleine-König, Software Engineer
Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
#2 lore raw

Re: [PATCH 2/2] ARM: ax88796: platform_get_irq() may return signed unnoticed

In reply to Roel Kluin
Quoted 1 line · Roel Kluin

similarly,

At the top of the file, it says:

* Copyright 2005,2007 Simtec Electronics
* Ben Dooks <[email protected]>

So adding Ben.

Quoted 29 lines

---
dev->irq is unsigned, platform_get_irq() may return signed unnoticed

---

drivers/net/ax88796.c +3 -4
index 194949a..26a735a 100644
@@ -838,10 +838,10 @@ static int ax_probe(struct platform_device *pdev)
 
 	/* find the platform resources */
 
-	dev->irq  = platform_get_irq(pdev, 0);
-	if (dev->irq < 0) {
+	ret  = platform_get_irq(pdev, 0);
+	dev->irq = ret;
+	if (ret < 0) {
 		dev_err(&pdev->dev, "no IRQ specified\n");
-		ret = -ENXIO;
 		goto exit_mem;
 	}
 
 
 
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
Applied
#4 lore raw
In reply to Roel Kluin
Quoted 16 lines · Roel Kluin

dev->irq is unsigned, platform_get_irq() may return signed unnoticed

---

drivers/net/arm/am79c961a.c +1 -2
index ba6bd03..a637910 100644
@@ -693,11 +693,15 @@ static int __init am79c961_probe(struct platform_device *pdev)
 	 * done by the ether bootp loader.
 	 */
 	dev->base_addr = res->start;
-	dev->irq = platform_get_irq(pdev, 0);
+	ret = platform_get_irq(pdev, 0);
 
-	ret = -ENODEV;

drivers/net/arm/am79c961a.c static int __init am79c961_probe(struct platform_device *pdev) · line 706

Quoted 10 lines
drivers/net/arm/am79c961a.c +6 -1
-	if (dev->irq < 0)
+	if (ret < 0) {
+		ret = -ENODEV;
 		goto nodev;
+	}
+	dev->irq = ret;
+
+	ret = -ENODEV;
 	if (!request_region(dev->base_addr, 0x18, dev->name))
 		goto nodev;

applied