alloc_tag: avoid implicit padding in uapi
PATCH v2 1/1 alloc_tag: avoid implicit padding in uapi
From: Arnd Bergmann <[email protected]>
The implied padding causes a harmless warning when testing the uapi headers with -Wpadded that could in theory indicate incompatibilities or data leaks:
./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]
The code here is fine, but it's better to make the padding explicit and avoid the warning here.
---
v2; fix changelog typos
--- include/uapi/linux/alloc_tag.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/alloc_tag.h +1 -0
@@ -38,6 +38,7 @@ struct allocinfo_counter {__u64 bytes;__u64 calls;__u8 accurate; +__u8 pad[7 ]; } __attribute__((aligned(8)));struct allocinfo_tag_data {
Signature · 1 line
2.53.0
Quoted 9 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The implied padding causes a harmless warning when testing the uapi headers with -Wpadded that could in theory indicate incompatibilities or data leaks:
./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]
Quoted 7 lines
The code here is fine, but it's better to make the padding explicit and avoid the warning here.
Acked-by SJ Park <[email protected]>Acked-by Hao Ge <[email protected]>Fixes 1d581ab2348c ("alloc_tag: add ioctl to /proc/allocinfo")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 21 lines
---
v2; fix changelog typos--- include/uapi/linux/alloc_tag.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/alloc_tag.h +1
-1@@ -38,6 +38,7 @@ struct allocinfo_counter {__u64 bytes;__u64 calls;__u8 accurate; +__u8 pad[7 ]; } __attribute__((aligned(8)));struct allocinfo_tag_data { --2.53.0