From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "G.N. Zhou" <guoniu.zhou@nxp.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>, Frank Li <frank.li@nxp.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXT] Re: [PATCH v2 2/5] media: nxp: imx8-isi: Simplify code by using helper macro
Date: Mon, 3 Nov 2025 01:14:40 +0200 [thread overview]
Message-ID: <20251102231440.GA1933@pendragon.ideasonboard.com> (raw)
In-Reply-To: <AS8PR04MB9080158655C3EA188BE7FE7AFA12A@AS8PR04MB9080.eurprd04.prod.outlook.com>
On Mon, Sep 22, 2025 at 02:03:44AM +0000, G.N. Zhou wrote:
> On Monday, September 22, 2025 6:13 AM, Laurent Pinchart wrote:
> > On Fri, Sep 05, 2025 at 02:55:59PM +0800, Guoniu Zhou wrote:
> > > Simplify code by using helper macro FIELD_PREP() and GENMASK().
> >
> > I'm not necessarily against this change, but how does it "simplify code"
> > ? There's no change in the code beside the macros, and they don't look
> > particularly simpler.
>
> How about the message body change to " Make code more readable and easier to maintain by
> using the FIELD_PREP and GENMASK(). macro" and title change to "Refine code by using helper macro"?
> If you agree, I could apply it in next version.
No need to send a new version, I'll update the commit message myself.
> > > No functions changed.
> > >
> > > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > > Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
> > > ---
> > > drivers/media/platform/nxp/imx8-isi/imx8-isi-gasket.c | 7 ++++---
> > > 1 file changed, 4 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-gasket.c
> > > b/drivers/media/platform/nxp/imx8-isi/imx8-isi-gasket.c
> > > index
> > >
> > f69c3b5d478209c083738477edf380e3f280c471..2f5e7299b537d612fb1fe668
> > 8c1b
> > > 75bfd2d6049b 100644
> > > --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-gasket.c
> > > +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-gasket.c
> > > @@ -3,6 +3,8 @@
> > > * Copyright 2019-2023 NXP
> > > */
> > >
> > > +#include <linux/bitfield.h>
> > > +#include <linux/bits.h>
> > > #include <linux/regmap.h>
> > >
> > > #include <media/mipi-csi2.h>
> > > @@ -16,8 +18,7 @@
> > > #define GASKET_BASE(n) (0x0060 + (n) * 0x30)
> > >
> > > #define GASKET_CTRL 0x0000
> > > -#define GASKET_CTRL_DATA_TYPE(dt) ((dt) << 8)
> > > -#define GASKET_CTRL_DATA_TYPE_MASK (0x3f << 8)
> > > +#define GASKET_CTRL_DATA_TYPE(dt) FIELD_PREP(GENMASK(13, 8),
> > (dt))
> >
> > I think you can omit the parentheses around dt here, and around x below.
>
> Ok, will apply in next version.
>
> >
> > > #define GASKET_CTRL_DUAL_COMP_ENABLE BIT(1)
> > > #define GASKET_CTRL_ENABLE BIT(0)
> > >
> > > @@ -58,7 +59,7 @@ const struct mxc_gasket_ops mxc_imx8_gasket_ops = {
> > > */
> > >
> > > #define DISP_MIX_CAMERA_MUX 0x30
> > > -#define DISP_MIX_CAMERA_MUX_DATA_TYPE(x) (((x) & 0x3f) << 3)
> > > +#define DISP_MIX_CAMERA_MUX_DATA_TYPE(x)
> > FIELD_PREP(GENMASK(8, 3), (x))
> > > #define DISP_MIX_CAMERA_MUX_GASKET_ENABLE BIT(16)
> > >
> > > static void mxc_imx93_gasket_enable(struct mxc_isi_dev *isi,
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2025-11-02 23:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 6:55 [PATCH v2 0/5] media: imx91: Add ISI support Guoniu Zhou
2025-09-05 6:55 ` [PATCH v2 1/5] media: dt-bindings: nxp,imx8-isi: Add i.MX91 ISI compatible string Guoniu Zhou
2025-09-21 22:10 ` Laurent Pinchart
2025-09-05 6:55 ` [PATCH v2 2/5] media: nxp: imx8-isi: Simplify code by using helper macro Guoniu Zhou
2025-09-21 22:13 ` Laurent Pinchart
2025-09-22 2:03 ` [EXT] " G.N. Zhou
2025-11-02 23:14 ` Laurent Pinchart [this message]
2025-11-03 2:03 ` G.N. Zhou
2025-09-05 6:56 ` [PATCH v2 3/5] media: nxp: imx8-isi: Add parallel camera input support Guoniu Zhou
2025-09-21 22:18 ` Laurent Pinchart
2025-09-22 2:16 ` [EXT] " G.N. Zhou
2025-09-05 6:56 ` [PATCH v2 4/5] media: nxp: imx8-isi: Reorder the platform data Guoniu Zhou
2025-09-21 22:20 ` Laurent Pinchart
2025-09-05 6:56 ` [PATCH v2 5/5] media: nxp: imx8-isi: Add ISI support for i.MX91 Guoniu Zhou
2025-09-21 22:27 ` Laurent Pinchart
2025-09-22 2:06 ` [EXT] " G.N. Zhou
2025-09-19 2:40 ` [PATCH v2 0/5] media: imx91: Add ISI support G.N. Zhou
2025-09-19 16:11 ` Frank Li
2025-09-21 16:07 ` Laurent Pinchart
2025-09-21 22:30 ` Laurent Pinchart
2025-09-22 2:10 ` [EXT] " G.N. Zhou
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=20251102231440.GA1933@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=frank.li@nxp.com \
--cc=guoniu.zhou@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox