Commit e6cc7108 authored by Allen Pais's avatar Allen Pais Committed by Mauro Carvalho Chehab

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: default avatarAllen Pais <allen.lkml@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 34d340b7
...@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = { ...@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
IA_CSS_FRAME_FORMAT_YUYV IA_CSS_FRAME_FORMAT_YUYV
}; };
#define array_length(array) (sizeof(array)/sizeof(array[0]))
/* Verify whether the selected output format is can be produced /* Verify whether the selected output format is can be produced
* by the copy binary given the stream format. * by the copy binary given the stream format.
* */ * */
...@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe) ...@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
switch (pipe->stream->config.input_config.format) { switch (pipe->stream->config.input_config.format) {
case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
case IA_CSS_STREAM_FORMAT_YUV420_8: case IA_CSS_STREAM_FORMAT_YUV420_8:
for (i=0; i<array_length(yuv420_copy_formats) && !found; i++) for (i=0; i<ARRAY_SIZE(yuv420_copy_formats) && !found; i++)
found = (out_fmt == yuv420_copy_formats[i]); found = (out_fmt == yuv420_copy_formats[i]);
break; break;
case IA_CSS_STREAM_FORMAT_YUV420_10: case IA_CSS_STREAM_FORMAT_YUV420_10:
...@@ -476,7 +474,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe) ...@@ -476,7 +474,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16); found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16);
break; break;
case IA_CSS_STREAM_FORMAT_YUV422_8: case IA_CSS_STREAM_FORMAT_YUV422_8:
for (i=0; i<array_length(yuv422_copy_formats) && !found; i++) for (i=0; i<ARRAY_SIZE(yuv422_copy_formats) && !found; i++)
found = (out_fmt == yuv422_copy_formats[i]); found = (out_fmt == yuv422_copy_formats[i]);
break; break;
case IA_CSS_STREAM_FORMAT_YUV422_10: case IA_CSS_STREAM_FORMAT_YUV422_10:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment