Skip to content

Commit e6cc710

Browse files
Allen Paismchehab
authored andcommitted
media: atomisp:use ARRAY_SIZE() instead of open coding
The array_length() macro just duplicates ARRAY_SIZE(), so we can delete it. Signed-off-by: Allen Pais <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 34d340b commit e6cc710

File tree

1 file changed

+2
-4
lines changed
  • drivers/staging/media/atomisp/pci/atomisp2/css2400

1 file changed

+2
-4
lines changed

drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
451451
IA_CSS_FRAME_FORMAT_YUYV
452452
};
453453

454-
#define array_length(array) (sizeof(array)/sizeof(array[0]))
455-
456454
/* Verify whether the selected output format is can be produced
457455
* by the copy binary given the stream format.
458456
* */
@@ -468,15 +466,15 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
468466
switch (pipe->stream->config.input_config.format) {
469467
case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
470468
case IA_CSS_STREAM_FORMAT_YUV420_8:
471-
for (i=0; i<array_length(yuv420_copy_formats) && !found; i++)
469+
for (i=0; i<ARRAY_SIZE(yuv420_copy_formats) && !found; i++)
472470
found = (out_fmt == yuv420_copy_formats[i]);
473471
break;
474472
case IA_CSS_STREAM_FORMAT_YUV420_10:
475473
case IA_CSS_STREAM_FORMAT_YUV420_16:
476474
found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16);
477475
break;
478476
case IA_CSS_STREAM_FORMAT_YUV422_8:
479-
for (i=0; i<array_length(yuv422_copy_formats) && !found; i++)
477+
for (i=0; i<ARRAY_SIZE(yuv422_copy_formats) && !found; i++)
480478
found = (out_fmt == yuv422_copy_formats[i]);
481479
break;
482480
case IA_CSS_STREAM_FORMAT_YUV422_10:

0 commit comments

Comments
 (0)