]> git.baikalelectronics.ru Git - kernel.git/commit
media: ov7640: Use ARRAY_SIZE instead of manual checking
authorMoses Christopher Bollavarapu <mosescb.dev@gmail.com>
Thu, 17 Mar 2022 14:47:14 +0000 (14:47 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:25:08 +0000 (08:25 +0100)
commite3f3bef0dde9629ef17ed835b0e8023bb61e6c9a
treecdbbf1492af4ec10d3984ae1cca7af59c85f09c5
parentd4db524cf505a2bc414e59cfbf19d5fd1d27334f
media: ov7640: Use ARRAY_SIZE instead of manual checking

Currently, the driver ends the reg-val list with a 0xFF as a check to stop
the loop. Instead an array of reg-vals can be used to avoid this check,
by using the ARRAY_SIZE(arr) macro to obtain the length of the array and
iterate over it.

Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov7640.c