Skip to content

Commit 7e8e809

Browse files
thomasmeymchehab
authored andcommitted
media: staging/atomisp: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro, rather than explicitly coding some variant of it yourself. Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\) /ARRAY_SIZE(\1)/g' and manual check/verification. Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 8cd0cd0 commit 7e8e809

File tree

1 file changed

+2
-1
lines changed
  • drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src

1 file changed

+2
-1
lines changed

drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src/ifmtr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ more details.
2929
#endif
3030

3131
#include "system_global.h"
32+
#include <linux/kernel.h>
3233

3334
#ifdef USE_INPUT_SYSTEM_VERSION_2
3435

@@ -487,7 +488,7 @@ static void ifmtr_set_if_blocking_mode(
487488
{
488489
int i;
489490
bool block[] = { false, false, false, false };
490-
assert(N_INPUT_FORMATTER_ID <= (sizeof(block) / sizeof(block[0])));
491+
assert(N_INPUT_FORMATTER_ID <= (ARRAY_SIZE(block)));
491492

492493
#if !defined(IS_ISP_2400_SYSTEM)
493494
#error "ifmtr_set_if_blocking_mode: ISP_SYSTEM must be one of {IS_ISP_2400_SYSTEM}"

0 commit comments

Comments
 (0)