diff options
author | Kees Cook <keescook@chromium.org> | 2021-12-16 02:24:57 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-12-16 18:19:52 +0300 |
commit | 0859bbb07d06d1357734496ff198319f9bfcf1bf (patch) | |
tree | 9ba1041e4cea5a3cb7ddf8b493f37104fdc5645c /drivers/irqchip/irq-gic-v3.c | |
parent | c10f2f8b5d8027c1ea77f777f2d16cb9043a6c09 (diff) | |
download | linux-0859bbb07d06d1357734496ff198319f9bfcf1bf.tar.xz |
irqchip/ingenic-tcu: Use correctly sized arguments for bit field
The find.h APIs are designed to be used only on unsigned long arguments.
This can technically result in a over-read, but it is harmless in this
case. Regardless, fix it to avoid the warning seen under -Warray-bounds,
which we'd like to enable globally:
In file included from ./include/linux/bitmap.h:9,
from ./include/linux/cpumask.h:12,
from ./include/linux/smp.h:13,
from ./include/linux/lockdep.h:14,
from ./include/linux/mutex.h:17,
from ./include/linux/notifier.h:14,
from ./include/linux/clk.h:14,
from drivers/irqchip/irq-ingenic-tcu.c:7:
drivers/irqchip/irq-ingenic-tcu.c: In function 'ingenic_tcu_intc_cascade':
./include/linux/find.h:40:23: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Warray-bounds]
40 | val = *addr & GENMASK(size - 1, offset);
| ^~~~~
drivers/irqchip/irq-ingenic-tcu.c:30:18: note: while referencing 'irq_reg'
30 | uint32_t irq_reg, irq_mask;
| ^~~~~~~
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215232457.2069969-1-keescook@chromium.org
Diffstat (limited to 'drivers/irqchip/irq-gic-v3.c')
0 files changed, 0 insertions, 0 deletions