Commit efec194f576eebca8b0b3ac6e96fea05ae4567c9

Authored by Roel Kluin
Committed by Krzysztof Hałasa
1 parent 9f2c94928a

IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request().

The indexes were signed, so negatives were possible.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>

Showing 4 changed files with 4 additions and 4 deletions Side-by-side Diff

arch/arm/mach-ixp4xx/common.c
... ... @@ -117,7 +117,7 @@
117 117 }
118 118 EXPORT_SYMBOL(gpio_to_irq);
119 119  
120   -int irq_to_gpio(int irq)
  120 +int irq_to_gpio(unsigned int irq)
121 121 {
122 122 int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL;
123 123  
arch/arm/mach-ixp4xx/include/mach/gpio.h
... ... @@ -70,7 +70,7 @@
70 70 #include <asm-generic/gpio.h> /* cansleep wrappers */
71 71  
72 72 extern int gpio_to_irq(int gpio);
73   -extern int irq_to_gpio(int gpio);
  73 +extern int irq_to_gpio(unsigned int irq);
74 74  
75 75 #endif
arch/arm/mach-ixp4xx/include/mach/npe.h
... ... @@ -33,7 +33,7 @@
33 33 int npe_recv_message(struct npe *npe, void *msg, const char *what);
34 34 int npe_send_recv_message(struct npe *npe, void *msg, const char *what);
35 35 int npe_load_firmware(struct npe *npe, const char *name, struct device *dev);
36   -struct npe *npe_request(int id);
  36 +struct npe *npe_request(unsigned id);
37 37 void npe_release(struct npe *npe);
38 38  
39 39 #endif /* __IXP4XX_NPE_H */
arch/arm/mach-ixp4xx/ixp4xx_npe.c
... ... @@ -665,7 +665,7 @@
665 665 }
666 666  
667 667  
668   -struct npe *npe_request(int id)
  668 +struct npe *npe_request(unsigned id)
669 669 {
670 670 if (id < NPE_COUNT)
671 671 if (npe_tab[id].valid)