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
This commit is contained in:
Jérémy Lefaure
2017-10-01 15:30:50 -04:00
committed by Thomas Gleixner
부모 33d930e59a
커밋 0cfe5b5fc0
3개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제

파일 보기

@@ -241,9 +241,9 @@ static int vga_probe(void)
vga_modes,
};
static int mode_count[] = {
sizeof(cga_modes)/sizeof(struct mode_info),
sizeof(ega_modes)/sizeof(struct mode_info),
sizeof(vga_modes)/sizeof(struct mode_info),
ARRAY_SIZE(cga_modes),
ARRAY_SIZE(ega_modes),
ARRAY_SIZE(vga_modes),
};
struct biosregs ireg, oreg;