]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
x86: Use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Sun, 1 Oct 2017 19:30:50 +0000 (15:30 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 19 Oct 2017 14:15:47 +0000 (16:15 +0200)
commit0cfe5b5fc0277463fa795dea312a3a2fd5e8bac2
tree8a572441fff7dbd736c7c9029fbe5b40932d5572
parent33d930e59a98fa10a0db9f56c7fa2f21a4aef9b9
x86: Use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-video@atrey.karlin.mff.cuni.cz
Cc: Martin Mares <mj@ucw.cz>
Cc: Andy Lutomirski <luto@amacapital.net>
Link: https://lkml.kernel.org/r/20171001193101.8898-13-jeremy.lefaure@lse.epita.fr
arch/x86/boot/video-vga.c
arch/x86/entry/vdso/vdso2c.c
arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c