gpio-timberdale: fix a potential wrapping issue
commit d79550a7bc
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0d81906849
commit
0659a31074
|
@ -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 &= ~(1UL << 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 |= 1UL << offset;
|
||||
iowrite32(tgpio->last_ier, tgpio->membase + TGPIO_IER);
|
||||
spin_unlock_irqrestore(&tgpio->lock, flags);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue