[Outreachy kernel] [PATCH 3/3] staging/rtl8712: use BIT macro

Dan Carpenter dan.carpenter at oracle.com
Tue Oct 27 12:44:17 UTC 2020


On Tue, Oct 20, 2020 at 07:44:04PM +0100, Matthew Wilcox wrote:
> On Tue, Oct 20, 2020 at 11:24:39AM -0700, Elena Afanasova wrote:
> > Reported by checkpatch.pl
> 
> Checkpatch is wrong.
> 
> > +++ b/drivers/staging/rtl8712/rtl871x_recv.h
> > @@ -8,7 +8,7 @@
> >  #define NR_RECVFRAME 256
> >  
> >  #define RXFRAME_ALIGN	8
> > -#define RXFRAME_ALIGN_SZ	(1 << RXFRAME_ALIGN)
> > +#define RXFRAME_ALIGN_SZ	BIT(RXFRAME_ALIGN)

Yeah.  It's weird to talk about size as a BIT() flag.  The RXFRAME_ALIGN
is not needed.  Just say:

-#define RXFRAME_ALIGN      8
-#define RXFRAME_ALIGN_SZ   (1 << RXFRAME_ALIGN)
+#define RXFRAME_ALIGN_SZ 256

This is literally used for aligning the RX frame.  It seems like a crazy
thing to me that to aligned at 256 bytes.  I would have expected 64 bit
alignment or page alignment but not 256 byte alignment...  Weird.

regards,
dan carpenter



More information about the devel mailing list