lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <AS8PR04MB9080158655C3EA188BE7FE7AFA12A@AS8PR04MB9080.eurprd04.prod.outlook.com>
Date: Mon, 22 Sep 2025 02:03:44 +0000
From: "G.N. Zhou" <guoniu.zhou@....com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
CC: Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
	Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>, Fabio Estevam
	<festevam@...il.com>, Frank Li <frank.li@....com>,
	"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [EXT] Re: [PATCH v2 2/5] media: nxp: imx8-isi: Simplify code by
 using helper macro

Hi Laurent,

Thanks for your reviewing.

> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Sent: Monday, September 22, 2025 6:13 AM
> To: G.N. Zhou <guoniu.zhou@....com>
> Cc: Mauro Carvalho Chehab <mchehab@...nel.org>; Rob Herring
> <robh@...nel.org>; Krzysztof Kozlowski <krzk+dt@...nel.org>; Conor Dooley
> <conor+dt@...nel.org>; Shawn Guo <shawnguo@...nel.org>; Sascha Hauer
> <s.hauer@...gutronix.de>; Pengutronix Kernel Team
> <kernel@...gutronix.de>; Fabio Estevam <festevam@...il.com>; Frank Li
> <frank.li@....com>; linux-media@...r.kernel.org; devicetree@...r.kernel.org;
> imx@...ts.linux.dev; linux-arm-kernel@...ts.infradead.org; linux-
> kernel@...r.kernel.org
> Subject: [EXT] Re: [PATCH v2 2/5] media: nxp: imx8-isi: Simplify code by using
> helper macro
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> Hi Guoniu,
> 
> Thank you for the patch.
> 
> 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 functions changed.
> >
> > Reviewed-by: Frank Li <Frank.Li@....com>
> > Signed-off-by: Guoniu Zhou <guoniu.zhou@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ