RE: [PATCH net-next 2/5] net: renesas: rswitch: Rename GWCA related definitions

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

 



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@xxxxxxxxxxx> wrote:
> > Rename GWCA related definitions to improve readability.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
> 
> 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@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