]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request().
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 3 Nov 2009 22:05:32 +0000 (23:05 +0100)
committerKrzysztof Hałasa <khc@pm.waw.pl>
Sat, 5 Dec 2009 15:58:38 +0000 (16:58 +0100)
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>
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-ixp4xx/include/mach/gpio.h
arch/arm/mach-ixp4xx/include/mach/npe.h
arch/arm/mach-ixp4xx/ixp4xx_npe.c

index cfd52fb341cb0545558006cf806df799cbdc379f..3bbf40f6d964b277a7a153fa6a93e694c73ff9da 100644 (file)
@@ -117,7 +117,7 @@ int gpio_to_irq(int gpio)
 }
 EXPORT_SYMBOL(gpio_to_irq);
 
-int irq_to_gpio(int irq)
+int irq_to_gpio(unsigned int irq)
 {
        int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL;
 
index cd5aec26c072d3d218cd171ad8cb02635529ba84..a5f87ded2f28bd8e039d8c09ac04db6e8fc43d50 100644 (file)
@@ -70,7 +70,7 @@ static inline void gpio_set_value(unsigned gpio, int value)
 #include <asm-generic/gpio.h>                  /* cansleep wrappers */
 
 extern int gpio_to_irq(int gpio);
-extern int irq_to_gpio(int gpio);
+extern int irq_to_gpio(unsigned int irq);
 
 #endif
 
index 37d0511689dc343873c57414f0554138a66efcac..e320db2457ae931eab7d6257f67ab8ea89d14f85 100644 (file)
@@ -33,7 +33,7 @@ int npe_send_message(struct npe *npe, const void *msg, const char *what);
 int npe_recv_message(struct npe *npe, void *msg, const char *what);
 int npe_send_recv_message(struct npe *npe, void *msg, const char *what);
 int npe_load_firmware(struct npe *npe, const char *name, struct device *dev);
-struct npe *npe_request(int id);
+struct npe *npe_request(unsigned id);
 void npe_release(struct npe *npe);
 
 #endif /* __IXP4XX_NPE_H */
index 47ac69c7ec7891a6bbbd07765fa264210746df35..e8bb257781661da9424208d8f79862cc088e377f 100644 (file)
@@ -665,7 +665,7 @@ err:
 }
 
 
-struct npe *npe_request(int id)
+struct npe *npe_request(unsigned id)
 {
        if (id < NPE_COUNT)
                if (npe_tab[id].valid)