Re: [PATCHv2 net-next 0/3] RDMA/cxgb4,cxgb4vf,cxgb4i,csiostor: Cleanup macros

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

 



On Wed, Nov 05, 2014 at 14:54:43 -0500, David Miller wrote:
> From: Hariprasad Shenai <hariprasad@xxxxxxxxxxx>
> Date: Tue,  4 Nov 2014 08:20:54 +0530
> 
> > It's not really the "hardware" which generates these hardware constant symbolic
> > macros/register defines of course, it's scripts developed by the hardware team.
> > Various patches have ended up changing the style of the symbolic macros/register
> > defines and some of them used the macros/register defines that matches the
> > output of the script from the hardware team.
> 
> We've told you that we don't care what format your internal whatever uses
> for these macros.
> 
> We have standards, tastes, and desires and reasons for naming macros
> in a certain way in upstream kernel code.
> 
> I consider it flat out unacceptable to use macros with one letter
> prefixes like "S_".  You simply should not do this.
> 

Okay. We’ll clean up all of the macros to match the files' original style. We
do need to change the sense of the *_MASK macros since they don’t match how we 
use them as field tokens.  Also the *_SHIFT, *_MASK and *_GET names are
sucking up space and making lines wrap unnecessarily, creating readability
problems.  Can we change these to *_S, *_M and *_G?  E.g.:

-#define  INGPADBOUNDARY_MASK    0x00000070U
-#define  INGPADBOUNDARY_SHIFT   4
-#define  INGPADBOUNDARY(x)      ((x) << INGPADBOUNDARY_SHIFT)
-#define  INGPADBOUNDARY_GET(x)  (((x) & INGPADBOUNDARY_MASK) \
-                                 >> INGPADBOUNDARY_SHIFT)
+#define  INGPADBOUNDARY_M       0x00000007U
+#define  INGPADBOUNDARY_S       4
+#define  INGPADBOUNDARY(x)      ((x) << INGPADBOUNDARY_S)
+#define  INGPADBOUNDARY_G(x)    (((x) >> INGPADBOUNDARY_S) \
+                                 & INGPADBOUNDARY_M)


 
Thanks,
Hari
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux