On 17.03.2025 13:32:37, Biju Das wrote: > Hi Marc, > > Thanks for the feedback. > > > -----Original Message----- > > From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> > > Sent: 17 March 2025 12:52 > > Subject: Re: [PATCH v5 07/16] can: rcar_canfd: Add rnc_field_width variable to struct > > rcar_canfd_hw_info > > > > On 17.03.2025 12:36:01, Biju Das wrote: > > > R-Car Gen4 packs 2 RNC values in a 32-bit word, whereas R-Car Gen3 > > > packs up to 4 values in a 32-bit word. Handle this difference by > > > adding rnc_field_width variable to struct rcar_canfd_hw_info and > > > update the macro RCANFD_GAFLCFG. > > > > > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > > > --- > > > v5: > > > * New patch. > > > --- > > > drivers/net/can/rcar/rcar_canfd.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/net/can/rcar/rcar_canfd.c > > > b/drivers/net/can/rcar/rcar_canfd.c > > > index 32d700962d69..924a116cd9ab 100644 > > > --- a/drivers/net/can/rcar/rcar_canfd.c > > > +++ b/drivers/net/can/rcar/rcar_canfd.c > > > @@ -85,6 +85,7 @@ > > > ((gpriv)->fdmode ? RCANFD_GERFL_CMPOF : 0))) > > > > > > /* AFL Rx rules registers */ > > > +#define RCANFD_RNC_PER_REG(gpriv) (32 / (gpriv)->info->rnc_field_width) > > > > Nitpick/micro optimization: > > > > Rename that to something like rnc_stride and put in value you need, i.e. > > 1 or 2. > > you mean to drop the macro RCANFD_RNC_PER_REG and instead use .rnc_stride to store > the values {2 , 4} and avoid runtime computations (32 / rnc_field_width)?? ACK. And the values I gave as example were not correct, as you've only field width of 8 and 16. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature