Unified sizeof_member() Re-Proposed For Linux 5.5

Written by Michael Larabel in Linux Kernel on 8 December 2019 at 10:36 AM EST. 15 Comments
LINUX KERNEL
After not being merged for Linux 5.4, the new sizeof_member() macro as a unified means of calculating the size of a member of a struct has been volleyed for Linux 5.5 for possible inclusion on this last day of the merge window.

The Linux kernel to now has supported SIZEOF_FIELD, FIELD_SIZEOF, sizeof_field as means of calculating the size of a member of a C struct... The new sizeof_member looks to clean-up that code cruft that has accumulated over the years with converting all usage of the old macros over to this new unified macro.

Linus Torvalds didn't end up pulling the sizeof_member for Linux 5.4 and initially wasn't sure of the "size of member" name with the older approaches all being based off "size of field", but Google's Kees Cook has re-submitted the latest tree-wide conversion for Linux 5.5.

The pull request is pending while waiting to see if Linus honors it for this cycle prior to shipping Linux 5.5-rc1 tonight.
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