Skip to contentSkip to conversation

Input: Fix test of unsigned in altera_ps2_probe()

PATCH Applied Roel Kluin 2 participants 2 messages Dec 15, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Input: Fix test of unsigned in altera_ps2_probe()

ps2if->irq is unsigned so the test does not work.

---
Found using coccinelle: http://coccinelle.lip6.fr/

drivers/input/serio/altera_ps2.c +5 -3
index f479ea5..3aa8f2e 100644
@@ -83,7 +83,7 @@ static int altera_ps2_probe(struct platform_device *pdev)
 {
 	struct ps2if *ps2if;
 	struct serio *serio;
-	int error;
+	int error, irq;
 
 	ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL);
 	serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
@@ -108,11 +108,13 @@ static int altera_ps2_probe(struct platform_device *pdev)
 		goto err_free_mem;
 	}
 
-	ps2if->irq  = platform_get_irq(pdev, 0);
-	if (ps2if->irq < 0) {
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
 		error = -ENXIO;
 		goto err_free_mem;
 	}
+	ps2if->irq = irq;
 
 	if (!request_mem_region(ps2if->iomem_res->start,
 				resource_size(ps2if->iomem_res), pdev->name)) {
maintainer Applied
#1 lore raw
Quoted 2 lines · Roel Kluin

ps2if->irq is unsigned so the test does not work.

Applied, tahnk you.

Signature · 1 line
Dmitry