* [PATCH] staging: media: meson: vdec: matched alignment with parenthesis
@ 2021-04-08 22:19 Mitali Borkar
2021-04-09 7:30 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Mitali Borkar @ 2021-04-08 22:19 UTC (permalink / raw)
To: narmstrong, mchehab, gregkh, khilman, jbrunet, martin.blumenstingl
Cc: linux-media, linux-staging, linux-kernel, outreachy-kernel, mitali_s
Matched alignment with open parenthesis to meet linux kernel coding
style.
Reported by checkpatch
Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
---
drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
index 48869cc3d973..21e93a13356c 100644
--- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
+++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
@@ -81,7 +81,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess)
}
ret = amvdec_set_canvases(sess, (u32[]){ AV_SCRATCH_0, 0 },
- (u32[]){ 8, 0 });
+ (u32[]){ 8, 0 });
if (ret)
goto free_workspace;
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: media: meson: vdec: matched alignment with parenthesis
2021-04-08 22:19 [PATCH] staging: media: meson: vdec: matched alignment with parenthesis Mitali Borkar
@ 2021-04-09 7:30 ` Hans Verkuil
2021-04-09 8:40 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2021-04-09 7:30 UTC (permalink / raw)
To: Mitali Borkar, narmstrong, mchehab, gregkh, khilman, jbrunet,
martin.blumenstingl
Cc: linux-media, linux-staging, linux-kernel, outreachy-kernel, mitali_s
On 09/04/2021 00:19, Mitali Borkar wrote:
> Matched alignment with open parenthesis to meet linux kernel coding
> style.
> Reported by checkpatch
>
> Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> ---
> drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> index 48869cc3d973..21e93a13356c 100644
> --- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
> +++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> @@ -81,7 +81,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess)
> }
>
> ret = amvdec_set_canvases(sess, (u32[]){ AV_SCRATCH_0, 0 },
> - (u32[]){ 8, 0 });
> + (u32[]){ 8, 0 });
The alignment here is because the 2nd and 3rd arguments belong together, so
the alignment indicates that. In order to keep that I would add a newline
after 'sess,' as well. Same as is done in meson/vdec/codec_h264.c.
Regards,
Hans
> if (ret)
> goto free_workspace;
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: media: meson: vdec: matched alignment with parenthesis
2021-04-09 7:30 ` Hans Verkuil
@ 2021-04-09 8:40 ` Joe Perches
[not found] ` <CAHWmKdgj67+T=tWKPMDRt1fbLm7_VLiOmgKcrzBj6oCd5Xv8sw@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2021-04-09 8:40 UTC (permalink / raw)
To: Hans Verkuil, Mitali Borkar, narmstrong, mchehab, gregkh,
khilman, jbrunet, martin.blumenstingl
Cc: linux-media, linux-staging, linux-kernel, outreachy-kernel, mitali_s
On Fri, 2021-04-09 at 09:30 +0200, Hans Verkuil wrote:
> On 09/04/2021 00:19, Mitali Borkar wrote:
> > Matched alignment with open parenthesis to meet linux kernel coding
> > style.
> > Reported by checkpatch
> >
> > Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
> > ---
> > drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> > index 48869cc3d973..21e93a13356c 100644
> > --- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
> > +++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> > @@ -81,7 +81,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess)
> > }
> >
> >
> > ret = amvdec_set_canvases(sess, (u32[]){ AV_SCRATCH_0, 0 },
> > - (u32[]){ 8, 0 });
> > + (u32[]){ 8, 0 });
>
> The alignment here is because the 2nd and 3rd arguments belong together, so
> the alignment indicates that. In order to keep that I would add a newline
> after 'sess,' as well. Same as is done in meson/vdec/codec_h264.c.
Perhaps better as:
---
drivers/staging/media/meson/vdec/codec_mpeg12.c | 5 +++--
drivers/staging/media/meson/vdec/vdec_helpers.c | 2 +-
drivers/staging/media/meson/vdec/vdec_helpers.h | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
index 48869cc3d973..933f1cd16ce1 100644
--- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
+++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
@@ -65,6 +65,8 @@ static int codec_mpeg12_start(struct amvdec_session *sess)
struct amvdec_core *core = sess->core;
struct codec_mpeg12 *mpeg12;
int ret;
+ static const u32 canvas1[] = { AV_SCRATCH_0, 0 };
+ static const u32 canvas2[] = { 8, 0 };
mpeg12 = kzalloc(sizeof(*mpeg12), GFP_KERNEL);
if (!mpeg12)
@@ -80,8 +82,7 @@ static int codec_mpeg12_start(struct amvdec_session *sess)
goto free_mpeg12;
}
- ret = amvdec_set_canvases(sess, (u32[]){ AV_SCRATCH_0, 0 },
- (u32[]){ 8, 0 });
+ ret = amvdec_set_canvases(sess, canvas1, canvas2);
if (ret)
goto free_workspace;
diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c
index 7f07a9175815..df5c27266c44 100644
--- a/drivers/staging/media/meson/vdec/vdec_helpers.c
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.c
@@ -177,7 +177,7 @@ static int set_canvas_nv12m(struct amvdec_session *sess,
}
int amvdec_set_canvases(struct amvdec_session *sess,
- u32 reg_base[], u32 reg_num[])
+ const u32 reg_base[], const u32 reg_num[])
{
struct v4l2_m2m_buffer *buf;
u32 pixfmt = sess->pixfmt_cap;
diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.h b/drivers/staging/media/meson/vdec/vdec_helpers.h
index cfaed52ab526..ace8897c34fe 100644
--- a/drivers/staging/media/meson/vdec/vdec_helpers.h
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.h
@@ -17,7 +17,7 @@
* @reg_num: number of contiguous registers after each reg_base (including it)
*/
int amvdec_set_canvases(struct amvdec_session *sess,
- u32 reg_base[], u32 reg_num[]);
+ const u32 reg_base[], const u32 reg_num[]);
/* Helpers to read/write to the various IPs (DOS, PARSER) */
u32 amvdec_read_dos(struct amvdec_core *core, u32 reg);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: media: meson: vdec: matched alignment with parenthesis
[not found] ` <CAHWmKdgj67+T=tWKPMDRt1fbLm7_VLiOmgKcrzBj6oCd5Xv8sw@mail.gmail.com>
@ 2021-04-09 19:45 ` Martin Blumenstingl
0 siblings, 0 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2021-04-09 19:45 UTC (permalink / raw)
To: Mitali Borkar
Cc: Joe Perches, Hans Verkuil, Neil Armstrong, mchehab, Greg KH,
khilman, jbrunet, linux-media, linux-staging, linux-kernel,
outreachy-kernel, MITALI SUNIL
On Fri, Apr 9, 2021 at 7:00 PM Mitali Borkar <mitaliborkar810@gmail.com> wrote:
>
> Looks good, will try this.
if you re-send this patch then please include our mailing list:
linux-amlogic@lists.infradead.org
Thank you!
Martin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-09 19:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 22:19 [PATCH] staging: media: meson: vdec: matched alignment with parenthesis Mitali Borkar
2021-04-09 7:30 ` Hans Verkuil
2021-04-09 8:40 ` Joe Perches
[not found] ` <CAHWmKdgj67+T=tWKPMDRt1fbLm7_VLiOmgKcrzBj6oCd5Xv8sw@mail.gmail.com>
2021-04-09 19:45 ` Martin Blumenstingl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).