[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYBPR01MB5341170818E3104408B2A56AD84B9@TYBPR01MB5341.jpnprd01.prod.outlook.com>
Date: Tue, 30 May 2023 11:37:58 +0000
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
CC: "s.shtylyov@....ru" <s.shtylyov@....ru>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>, "geert+renesas@...der.be"
<geert+renesas@...der.be>, "magnus.damm@...il.com" <magnus.damm@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH net-next 2/5] net: renesas: rswitch: Rename GWCA related
definitions
Hi Geert-san,
> From: Geert Uytterhoeven, Sent: Tuesday, May 30, 2023 4:18 PM
>
> Hi Shimoda-san,
>
> On Mon, May 29, 2023 at 10:08 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@...esas.com> wrote:
> > Rename GWCA related definitions to improve readability.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/net/ethernet/renesas/rswitch.h
> > +++ b/drivers/net/ethernet/renesas/rswitch.h
>
> > @@ -959,9 +959,9 @@ struct rswitch_gwca {
> > int num_queues;
> > struct rswitch_gwca_queue ts_queue;
> > struct list_head ts_info_list;
> > - DECLARE_BITMAP(used, RSWITCH_MAX_NUM_QUEUES);
> > - u32 tx_irq_bits[RSWITCH_NUM_IRQ_REGS];
> > - u32 rx_irq_bits[RSWITCH_NUM_IRQ_REGS];
> > + DECLARE_BITMAP(used, GWCA_AXI_CHAIN_N);
> > + u32 tx_irq_bits[GWCA_NUM_IRQ_REGS];
> > + u32 rx_irq_bits[GWCA_NUM_IRQ_REGS];
>
> Not directly related to this patch, but is there a specific reason why
> tx_irq_bits and rx_irq_bits are arrays instead of bitmaps declared
> using DECLARE_BITMAP()? I think you can simplify the code that accesses
> them by using the bitmap APIs.
Using arrays is easy to understand to me about GWDI[ES]i registers' handling
in the following functions:
- rswitch_is_any_data_irq()
- rswitch_get_data_irq_status()
- rswitch_data_irq()
However, using bitmaps can avoid calculation of index and bit by division and modulo.
So, it seems better.
And, this is also not related to this patch though, I realized that separating
tx_irq_bits and gwca.rx_irq_bits is not needed.
Best regards,
Yoshihiro Shimoda
> > int speed;
> > };
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> 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
Powered by blists - more mailing lists