diff mbox series

[08/12] s390: syscall_wrapper: avoid clang warning

Message ID 20190408212648.2407234-8-arnd@arndb.de
State Accepted
Commit efb150df1de6462003890cbfea5fa02a28821530
Headers show
Series [01/12] s390: remove -fno-strength-reduce flag | expand

Commit Message

Arnd Bergmann April 8, 2019, 9:26 p.m. UTC
Building system calls with clang results in a warning
about an alias from a global function to a static one:

../fs/namei.c:3847:1: warning: unused function '__se_sys_mkdirat' [-Wunused-function]
SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
^
../include/linux/syscalls.h:219:36: note: expanded from macro 'SYSCALL_DEFINE3'
 #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
                                   ^
../include/linux/syscalls.h:228:2: note: expanded from macro 'SYSCALL_DEFINEx'
        __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
        ^
../arch/s390/include/asm/syscall_wrapper.h:126:18: note: expanded from macro '__SYSCALL_DEFINEx'
        asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))          \
                        ^
<scratch space>:31:1: note: expanded from here
__se_sys_mkdirat
^

The only reference to the static __se_sys_mkdirat() here is the alias, but
this only gets evaluated later. Making this function global as well avoids
the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
I considered opening a bug report for llvm here, but I suspect the
behavior is intentional, so I'm just fixing it here. Let me know if
you disagree.
---
 arch/s390/include/asm/syscall_wrapper.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.0

Comments

Martin Schwidefsky April 10, 2019, 4 p.m. UTC | #1
On Mon,  8 Apr 2019 23:26:21 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> Building system calls with clang results in a warning

> about an alias from a global function to a static one:

> 

> ../fs/namei.c:3847:1: warning: unused function '__se_sys_mkdirat' [-Wunused-function]

> SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)

> ^

> ../include/linux/syscalls.h:219:36: note: expanded from macro 'SYSCALL_DEFINE3'

>  #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)

>                                    ^

> ../include/linux/syscalls.h:228:2: note: expanded from macro 'SYSCALL_DEFINEx'

>         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)

>         ^

> ../arch/s390/include/asm/syscall_wrapper.h:126:18: note: expanded from macro '__SYSCALL_DEFINEx'

>         asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))          \

>                         ^

> <scratch space>:31:1: note: expanded from here

> __se_sys_mkdirat

> ^

> 

> The only reference to the static __se_sys_mkdirat() here is the alias, but

> this only gets evaluated later. Making this function global as well avoids

> the warning.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Added to s390/linux:features for the next merge window. Thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.
diff mbox series

Patch

diff --git a/arch/s390/include/asm/syscall_wrapper.h b/arch/s390/include/asm/syscall_wrapper.h
index 5596c5c625d2..3c3d6fe8e2f0 100644
--- a/arch/s390/include/asm/syscall_wrapper.h
+++ b/arch/s390/include/asm/syscall_wrapper.h
@@ -119,8 +119,8 @@ 
 		      "Type aliasing is used to sanitize syscall arguments");\
 	asmlinkage long __s390x_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))	\
 		__attribute__((alias(__stringify(__se_sys##name))));		\
-	ALLOW_ERROR_INJECTION(__s390x_sys##name, ERRNO);				\
-	static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__));		\
+	ALLOW_ERROR_INJECTION(__s390x_sys##name, ERRNO);			\
+	long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__));			\
 	static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));	\
 	__S390_SYS_STUBx(x, name, __VA_ARGS__)					\
 	asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))		\