All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
To: Ming Qian <ming.qian@nxp.com>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"X.H. Bao" <xiahong.bao@nxp.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [EXT] Re: [PATCH v5 2/4] media: amphion: tell and handle contiguous and non contiguous format
Date: Fri, 26 Aug 2022 10:27:17 +0200	[thread overview]
Message-ID: <20220826082717.GB3151@tom-ThinkPad-T14s-Gen-2i> (raw)
In-Reply-To: <AM6PR04MB634128ED70894F35B629C69AE7759@AM6PR04MB6341.eurprd04.prod.outlook.com>

Hi Ming,

On Fri, Aug 26, 2022 at 07:47:47AM +0000, Ming Qian wrote:
> [snip]
> 
> >> diff --git a/drivers/media/platform/amphion/vpu_helpers.c
> >> b/drivers/media/platform/amphion/vpu_helpers.c
> >> index e9aeb3453dfc..019c77e84514 100644
> >> --- a/drivers/media/platform/amphion/vpu_helpers.c
> >> +++ b/drivers/media/platform/amphion/vpu_helpers.c
> >> @@ -59,6 +59,36 @@ const struct vpu_format
> >*vpu_helper_find_format(struct vpu_inst *inst, u32 type,
> >>       return NULL;
> >>  }
> >>
> >> +const struct vpu_format *vpu_helper_find_sibling(struct vpu_inst
> >> +*inst, u32 type, u32 pixelfmt) {
> >> +     const struct vpu_format *fmt;
> >> +     const struct vpu_format *sibling;
> >> +
> >> +     fmt = vpu_helper_find_format(inst, type, pixelfmt);
> >> +     if (!fmt || !fmt->sibling)
> >> +             return NULL;
> >> +
> >> +     sibling = vpu_helper_find_format(inst, type, fmt->sibling);
> >> +     if (!sibling || sibling->sibling != fmt->pixfmt ||
> >> +         sibling->comp_planes != fmt->comp_planes)
> >> +             return NULL;
> >
> >I think to preserve code style you need the following solutions on this if
> >statement:
> >
> >if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> >    (sibling->comp_planes != fmt->comp_planes))
> >         return NULL;
> >
> >I think I have suggested to you this solution on the v4. But never mind we
> >need this :)
> >
> >Thanks
> >
> 
> Hi Tommaso,
>     The parentheses are unnecessary, the checkpatch.pl will report the following style problems if I add the parentheses:
> 
> CHECK: Unnecessary parentheses around 'sibling->sibling != fmt->pixfmt'
> #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72:
> +       if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> +           (sibling->comp_planes != fmt->comp_planes))
> 
> CHECK: Unnecessary parentheses around 'sibling->comp_planes != fmt->comp_planes'
> #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72:
> +       if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> +           (sibling->comp_planes != fmt->comp_planes))
> 
> total: 0 errors, 0 warnings, 2 checks, 10 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> 1.patch has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.

Sorry, my bad. I don't check this using checkpatch.pl, but checking the
others driver code, you are right. Thanks for clarify this.

Then, Looks good to me.

Regards,
Tommaso

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

WARNING: multiple messages have this Message-ID (diff)
From: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
To: Ming Qian <ming.qian@nxp.com>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"X.H. Bao" <xiahong.bao@nxp.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [EXT] Re: [PATCH v5 2/4] media: amphion: tell and handle contiguous and non contiguous format
Date: Fri, 26 Aug 2022 10:27:17 +0200	[thread overview]
Message-ID: <20220826082717.GB3151@tom-ThinkPad-T14s-Gen-2i> (raw)
In-Reply-To: <AM6PR04MB634128ED70894F35B629C69AE7759@AM6PR04MB6341.eurprd04.prod.outlook.com>

Hi Ming,

On Fri, Aug 26, 2022 at 07:47:47AM +0000, Ming Qian wrote:
> [snip]
> 
> >> diff --git a/drivers/media/platform/amphion/vpu_helpers.c
> >> b/drivers/media/platform/amphion/vpu_helpers.c
> >> index e9aeb3453dfc..019c77e84514 100644
> >> --- a/drivers/media/platform/amphion/vpu_helpers.c
> >> +++ b/drivers/media/platform/amphion/vpu_helpers.c
> >> @@ -59,6 +59,36 @@ const struct vpu_format
> >*vpu_helper_find_format(struct vpu_inst *inst, u32 type,
> >>       return NULL;
> >>  }
> >>
> >> +const struct vpu_format *vpu_helper_find_sibling(struct vpu_inst
> >> +*inst, u32 type, u32 pixelfmt) {
> >> +     const struct vpu_format *fmt;
> >> +     const struct vpu_format *sibling;
> >> +
> >> +     fmt = vpu_helper_find_format(inst, type, pixelfmt);
> >> +     if (!fmt || !fmt->sibling)
> >> +             return NULL;
> >> +
> >> +     sibling = vpu_helper_find_format(inst, type, fmt->sibling);
> >> +     if (!sibling || sibling->sibling != fmt->pixfmt ||
> >> +         sibling->comp_planes != fmt->comp_planes)
> >> +             return NULL;
> >
> >I think to preserve code style you need the following solutions on this if
> >statement:
> >
> >if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> >    (sibling->comp_planes != fmt->comp_planes))
> >         return NULL;
> >
> >I think I have suggested to you this solution on the v4. But never mind we
> >need this :)
> >
> >Thanks
> >
> 
> Hi Tommaso,
>     The parentheses are unnecessary, the checkpatch.pl will report the following style problems if I add the parentheses:
> 
> CHECK: Unnecessary parentheses around 'sibling->sibling != fmt->pixfmt'
> #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72:
> +       if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> +           (sibling->comp_planes != fmt->comp_planes))
> 
> CHECK: Unnecessary parentheses around 'sibling->comp_planes != fmt->comp_planes'
> #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72:
> +       if (!sibling || (sibling->sibling != fmt->pixfmt) ||
> +           (sibling->comp_planes != fmt->comp_planes))
> 
> total: 0 errors, 0 warnings, 2 checks, 10 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> 1.patch has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.

Sorry, my bad. I don't check this using checkpatch.pl, but checking the
others driver code, you are right. Thanks for clarify this.

Then, Looks good to me.

Regards,
Tommaso

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-08-26  8:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  1:38 [PATCH v5 0/4] media: amphion: add support for contiguous format Ming Qian
2022-08-25  1:38 ` Ming Qian
2022-08-25  1:38 ` [PATCH v5 1/4] media: add nv12_8l128 and nv12_10be_8l128 video format Ming Qian
2022-08-25  1:38   ` Ming Qian
2022-08-25  1:38 ` [PATCH v5 2/4] media: amphion: tell and handle contiguous and non contiguous format Ming Qian
2022-08-25  1:38   ` Ming Qian
2022-08-26  7:20   ` Tommaso Merciai
2022-08-26  7:20     ` Tommaso Merciai
2022-08-26  7:47     ` [EXT] " Ming Qian
2022-08-26  7:47       ` Ming Qian
2022-08-26  8:27       ` Tommaso Merciai [this message]
2022-08-26  8:27         ` Tommaso Merciai
2022-08-26  8:34         ` Tommaso Merciai
2022-08-26  8:34           ` Tommaso Merciai
2022-08-25  1:38 ` [PATCH v5 3/4] media: amphion: decoder add support for contiguous planes Ming Qian
2022-08-25  1:38   ` Ming Qian
2022-08-25  1:38 ` [PATCH v5 4/4] media: amphion: encoder " Ming Qian
2022-08-25  1:38   ` Ming Qian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220826082717.GB3151@tom-ThinkPad-T14s-Gen-2i \
    --to=tommaso.merciai@amarulasolutions.com \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ming.qian@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xiahong.bao@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.