Linus Rejects "Size Of Member" Change From Linux 5.5 Kernel

Written by Michael Larabel in Linux Kernel on 9 December 2019 at 04:18 AM EST. 33 Comments
LINUX KERNEL
This weekend was the last-minute pull request by Google's Kees Cook to introduce the new sizeof_member() macro that had been previously rejected from Linux 5.4. Well, it was again rejected by Linus Torvalds prior to tagging the Linux 5.5-rc1 kernel.

The sizeof_member() macro has been aimed to unify 2~3 other macros within the kernel tree currently and using the size-of-field moniker, but Cook argued that for measuring the size of a member of a C struct, the new macro is more appropriate and converted usage of the old macros to this new single macro.

Torvalds erred on the side of caution and avoiding juvenile jokes, decided to not honor that pull request for Linux 5.5. He wrote:
So this one I'm _still_ not convinced about. It makes yet another name for something we've had before, which just annoys me. And maybe it's the 13-year old in me, but "sizeof_member()" just makes me go "that's puerile".

I _can_ see why we'd want to standardize on one of the tree versions we have, but I can't really see the problem with the existing #define that we have, and that is used (admittedly not all that much): sizeof_field().

Linus

Hopefully for Linux 5.6 we'll see the unification done for sizeof_field(). At least Linux 5.5 has a ton of practical changes.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week