[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TY3PR01MB11346C45891228113FBF409B0860CA@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Mon, 8 Sep 2025 10:38:19 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: geert <geert@...ux-m68k.org>, biju.das.au <biju.das.au@...il.com>
CC: Marc Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol
<mailhol.vincent@...adoo.fr>, magnus.damm <magnus.damm@...il.com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Prabhakar
Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: RE: [PATCH v2 2/4] can: rcar_canfd: Update RCANFD_CFG_* macros
Hi Geert,
Thanks for the feedback.
> -----Original Message-----
> From: Geert Uytterhoeven <geert@...ux-m68k.org>
> Sent: 01 September 2025 14:24
> Subject: Re: [PATCH v2 2/4] can: rcar_canfd: Update RCANFD_CFG_* macros
>
> Hi Biju,
>
> On Thu, 21 Aug 2025 at 16:14, Biju <biju.das.au@...il.com> wrote:
> > From: Biju Das <biju.das.jz@...renesas.com>
> >
> > Update RCANFD_CFG_* macros to give a meaning to the magic number using
> > GENMASK macro and extract the values using FIELD_PREP macro.
> >
> > Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> > ---
> > v1->v2:
> > * Moved from patch#4 to patch#2.
> > * Updated commit header and description.
> > * Kept RCANFD_CFG* macro definitions to give a meaning to the magic
> > number using GENMASK macro and used FIELD_PREP to extract value.
>
> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -103,10 +103,10 @@
> > /* Channel register bits */
> >
> > /* RSCFDnCmCFG - Classical CAN only */
> > -#define RCANFD_CFG_SJW(x) (((x) & 0x3) << 24)
> > -#define RCANFD_CFG_TSEG2(x) (((x) & 0x7) << 20)
> > -#define RCANFD_CFG_TSEG1(x) (((x) & 0xf) << 16)
> > -#define RCANFD_CFG_BRP(x) (((x) & 0x3ff) << 0)
> > +#define RCANFD_CFG_SJW_MASK GENMASK(25, 24)
> > +#define RCANFD_CFG_TSEG2_MASK GENMASK(22, 20)
> > +#define RCANFD_CFG_TSEG1_MASK GENMASK(19, 16)
> > +#define RCANFD_CFG_BRP_MASK GENMASK(9, 0)
>
> Upon a second look, I would drop the "_MASK" suffix.
OK, will drop the "_MASK" suffix in next version.
Cheers,
Biju
Powered by blists - more mailing lists