RE: [PATCH v8 05/19] can: rcar_canfd: Update RCANFD_GERFL_ERR macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 16 April 2025 14:36
> Subject: Re: [PATCH v8 05/19] can: rcar_canfd: Update RCANFD_GERFL_ERR macro
> 
> Hi Biju,
> 
> On Wed, 2 Apr 2025 at 12:22, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Replace the macro RCANFD_GERFL_EEF0_7->RCANFD_GERFL_EEF. The macros
> > RCANFD_GERFL_EEF* in RCANFD_GERFL_ERR can be replaced by FIELD_PREP()
> > and drop the redundant macro RCANFD_GERFL_EEF(ch).
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > ---
> > v7->v8:
> >  * Updated commit description.
> >  * Replaced the macro RCANFD_GERFL_EEF0_7->RCANFD_GERFL_EEF.
> >  * Dropped the redundant macro RCANFD_GERFL_EEF(ch).
> >  * Dropped the tag.
> 
> Thanks for the update!
> 
> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -74,18 +74,18 @@
> >  #define RCANFD_GSTS_GNOPM              (BIT(0) | BIT(1) | BIT(2) | BIT(3))
> >
> >  /* RSCFDnCFDGERFL / RSCFDnGERFL */
> > -#define RCANFD_GERFL_EEF0_7            GENMASK(23, 16)
> > -#define RCANFD_GERFL_EEF(ch)           BIT(16 + (ch))
> > +#define RCANFD_GERFL_EEF               GENMASK(23, 16)
> >  #define RCANFD_GERFL_CMPOF             BIT(3)  /* CAN FD only */
> >  #define RCANFD_GERFL_THLES             BIT(2)
> >  #define RCANFD_GERFL_MES               BIT(1)
> >  #define RCANFD_GERFL_DEF               BIT(0)
> >
> >  #define RCANFD_GERFL_ERR(gpriv, x) \
> > -       ((x) & (reg_gen4(gpriv, RCANFD_GERFL_EEF0_7, \
> > -                        RCANFD_GERFL_EEF(0) | RCANFD_GERFL_EEF(1)) | \
> > -               RCANFD_GERFL_MES | \
> > -               ((gpriv)->fdmode ? RCANFD_GERFL_CMPOF : 0)))
> > +({\
> > +       typeof(gpriv) (_gpriv) = (gpriv); \
> > +       ((x) & ((FIELD_PREP(RCANFD_GERFL_EEF, (_gpriv)->channels_mask)) | \
> > +               RCANFD_GERFL_MES | ((_gpriv)->fdmode ?
> > +RCANFD_GERFL_CMPOF : 0))); \
> > +})
> >
> >  /* AFL Rx rules registers */
> >
> > @@ -938,7 +938,7 @@ static void rcar_canfd_global_error(struct net_device *ndev)
> >         u32 ridx = ch + RCANFD_RFFIFO_IDX;
> >
> >         gerfl = rcar_canfd_read(priv->base, RCANFD_GERFL);
> > -       if (gerfl & RCANFD_GERFL_EEF(ch)) {
> > +       if (gerfl & FIELD_PREP(RCANFD_GERFL_EEF, ch)) {
> 
> BIT(ch)

Oops. Missed it. Will fix along with header for FIELD_PREP.

Cheers,
Biju

> 
> >                 netdev_dbg(ndev, "Ch%u: ECC Error flag\n", ch);
> >                 stats->tx_dropped++;
> >         }
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
> 
> In personal conversations with technical people, I call myself a hacker. But when I'm talking to
> journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux