git.openpandora.org
/
pandora-kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bdf24c1
)
gpio-timberdale: fix a potential wrapping issue
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 11 Oct 2012 06:56:35 +0000
(09:56 +0300)
committer
Ben Hutchings
<ben@decadent.org.uk>
Fri, 16 Nov 2012 16:46:52 +0000
(16:46 +0000)
commit
d79550a7bc35c16476ebdc27c78378d8093390ec
upstream.
->last_ier is an unsigned long but the high bits can't be used int the
original code because the shift wraps.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpio/gpio-timberdale.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-timberdale.c
b/drivers/gpio/gpio-timberdale.c
index
c593bd4
..
edff410
100644
(file)
--- a/
drivers/gpio/gpio-timberdale.c
+++ b/
drivers/gpio/gpio-timberdale.c
@@
-116,7
+116,7
@@
static void timbgpio_irq_disable(struct irq_data *d)
unsigned long flags;
spin_lock_irqsave(&tgpio->lock, flags);
- tgpio->last_ier &= ~(1 << offset);
+ tgpio->last_ier &= ~(1
UL
<< offset);
iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
spin_unlock_irqrestore(&tgpio->lock, flags);
}
@@
-128,7
+128,7
@@
static void timbgpio_irq_enable(struct irq_data *d)
unsigned long flags;
spin_lock_irqsave(&tgpio->lock, flags);
- tgpio->last_ier |= 1 << offset;
+ tgpio->last_ier |= 1
UL
<< offset;
iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
spin_unlock_irqrestore(&tgpio->lock, flags);
}