Re: [PATCH net-next v11 3/5] net: rnpgbe: Add basic mbx ops support

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

 



On Wed, 10 Sep 2025 13:56:36 +0800 Yibo Dong wrote:
> > Not sure this is really necessary, I'd expect C programmers to intuit 
> > that 4 is the number of bytes in u32 here. sizeof(u32) is going to
> > overflow 80 char line limit and cause more harm than good.
> >   
> 
> I found similar code in other drivers, ixgbe, it like this:
> 
> #define IXGBE_READ_REG_ARRAY(a, reg, offset) \
>                  ixgbe_read_reg((a), (reg) + ((offset) << 2))
> 
>          for (i = 0; i < size; i++)
>                  msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i);
> 
> Maybe I should follow that style?

Personal preference at this stage, but I like your code more.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux