Skip to content

Commit 3a1d382

Browse files
ubizjakIngo Molnar
authored andcommitted
x86/percpu: Avoid sparse warning with cast to named address space
Teach sparse about __seg_fs and __seg_gs named address space qualifiers to to avoid warnings about unexpected keyword at the end of cast operator. Reported-by: kernel test robot <[email protected]> Acked-by: Luc Van Oostenryck <[email protected]> Signed-off-by: Uros Bizjak <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
1 parent 13408c6 commit 3a1d382

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/include/asm/percpu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636

3737
#ifdef CONFIG_CC_HAS_NAMED_AS
3838

39+
#ifdef __CHECKER__
40+
#define __seg_gs __attribute__((address_space(__seg_gs)))
41+
#define __seg_fs __attribute__((address_space(__seg_fs)))
42+
#endif
43+
3944
#ifdef CONFIG_X86_64
4045
#define __percpu_seg_override __seg_gs
4146
#else

0 commit comments

Comments
 (0)