diff options
| author | Peng Jiang <[email protected]> | 2025-03-24 11:12:30 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2025-04-10 09:07:10 +0000 |
| commit | acea9943271b62905033f2f8ca571cdd52d6ea7b (patch) | |
| tree | da0ee158354bdf495f9e6b35f9c5b13d86b63cab /rust/helpers/platform.c | |
| parent | timekeeping: Add a lockdep override in tick_freeze() (diff) | |
| download | kernel-acea9943271b62905033f2f8ca571cdd52d6ea7b.tar.gz kernel-acea9943271b62905033f2f8ca571cdd52d6ea7b.zip | |
vdso: Address variable shadowing in macros
Compiling the kernel with gcc12.3 W=2 results in shadowing warnings:
warning: declaration of '__pptr' shadows a previous local [-Wshadow]
const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);
note: in definition of macro '__put_unaligned_t'
__pptr->x = (val);
note: in expansion of macro '__get_unaligned_t'
__put_unaligned_t(type, __get_unaligned_t(type, src), dst);
__get_unaligned_t() and __put_unaligned_t() use a local variable named
'__pptr', which can lead to variable shadowing when these macros are used in
the same scope. This results in a -Wshadow warning during compilation.
To address this issue, rename the local variables within the macros to
ensure uniqueness.
Signed-off-by: Peng Jiang <[email protected]>
Signed-off-by: Shao Mingyin <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions
