IA_CSS_FRAME_FORMAT_YUYV
 };
 
-#define array_length(array) (sizeof(array)/sizeof(array[0]))
-
 /* Verify whether the selected output format is can be produced
  * by the copy binary given the stream format.
  * */
        switch (pipe->stream->config.input_config.format) {
        case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
        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]);
                break;
        case IA_CSS_STREAM_FORMAT_YUV420_10:
                found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16);
                break;
        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]);
                break;
        case IA_CSS_STREAM_FORMAT_YUV422_10: