Skip to content

Commit 55f1b54

Browse files
committed
tools headers: Update the linux/unaligned.h copy with the kernel sources
To pick up the changes in: 7f05381 ("random: vDSO: minimize and simplify header includes") That required adding a copy of include/vdso/unaligned.h and its checking in tools/perf/check-headers.h. Addressing this perf tools build warning: Warning: Kernel ABI header differences: diff -u tools/include/linux/unaligned.h include/linux/unaligned.h Please see tools/include/uapi/README for further details. Cc: Adrian Hunter <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jason A. Donenfeld <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/Zx-uHvAbPAESofEN@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 93e4b86 commit 55f1b54

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

tools/include/linux/unaligned.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@
99
#pragma GCC diagnostic push
1010
#pragma GCC diagnostic ignored "-Wpacked"
1111
#pragma GCC diagnostic ignored "-Wattributes"
12-
13-
#define __get_unaligned_t(type, ptr) ({ \
14-
const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
15-
__pptr->x; \
16-
})
17-
18-
#define __put_unaligned_t(type, val, ptr) do { \
19-
struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
20-
__pptr->x = (val); \
21-
} while (0)
12+
#include <vdso/unaligned.h>
2213

2314
#define get_unaligned(ptr) __get_unaligned_t(typeof(*(ptr)), (ptr))
2415
#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))

tools/include/vdso/unaligned.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __VDSO_UNALIGNED_H
3+
#define __VDSO_UNALIGNED_H
4+
5+
#define __get_unaligned_t(type, ptr) ({ \
6+
const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
7+
__pptr->x; \
8+
})
9+
10+
#define __put_unaligned_t(type, val, ptr) do { \
11+
struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
12+
__pptr->x = (val); \
13+
} while (0)
14+
15+
#endif /* __VDSO_UNALIGNED_H */

tools/perf/check-headers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FILES=(
2222
"include/vdso/bits.h"
2323
"include/linux/const.h"
2424
"include/vdso/const.h"
25+
"include/vdso/unaligned.h"
2526
"include/linux/hash.h"
2627
"include/linux/list-sort.h"
2728
"include/uapi/linux/hw_breakpoint.h"

0 commit comments

Comments
 (0)