Re: [PATCH v3 2/2] IB/core: Align casting method of ib_device_cap_flags enumerations to ULL

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

 



On 06/06/2016 10:40 AM, Greg KH wrote:
On Mon, Jun 06, 2016 at 10:22:46AM -0700, hch wrote:
Later on, we will wrap all these shifts in BIT() macros as Greg suggested.

Big NAK to any use of that macro.

That's odd, given that most of the kernel has already converted to use
it.  You can try to keep it out of this subsystem, but you will get
patches to convert it from random people and it will wear you down over
time...

Hello Greg,

It is considered a bad programming practice to introduce macros that obfuscate C operations. All the BIT() macro does is a shift operation. Writing the shift explicitly instead of using the BIT() macro makes source code easier to read. So why has the BIT() macro ever been introduced?

Thanks,

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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]