* [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding.
@ 2017-09-13 8:57 Allen Pais
2017-09-13 9:10 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Allen Pais @ 2017-09-13 8:57 UTC (permalink / raw)
To: linux-kernel; +Cc: mchehab, gregkh, linux-media, devel, Allen Pais
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b55..bee3043 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
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.
* */
@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
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:
@@ -476,7 +474,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
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:
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding.
2017-09-13 8:57 [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding Allen Pais
@ 2017-09-13 9:10 ` Dan Carpenter
2017-09-13 9:17 ` Allen
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-09-13 9:10 UTC (permalink / raw)
To: Allen Pais; +Cc: linux-kernel, devel, gregkh, mchehab, linux-media
On Wed, Sep 13, 2017 at 02:27:53PM +0530, Allen Pais wrote:
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Sorry, the patch is right, but the commit is still totally messed up.
bad: [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding.
good: [PATCH v4] [media] atomisp: use ARRAY_SIZE() instead of open coding.
Please, copy the "[media] atomisp: " prefix exactly as I wrote it. Then
the commit message can say something like:
The array_length() macro just duplicates ARRAY_SIZE() so we can delete
it.
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> ---
^^^
Then under the --- line put:
v4: Update the commit message.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-13 9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-13 8:57 [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding Allen Pais
2017-09-13 9:10 ` Dan Carpenter
2017-09-13 9:17 ` Allen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox