Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751795AbdFKAA3 (ORCPT ); Sat, 10 Jun 2017 20:00:29 -0400 Received: from rs224.mailgun.us ([209.61.151.224]:51100 "EHLO rs224.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765AbdFKAA2 (ORCPT ); Sat, 10 Jun 2017 20:00:28 -0400 X-Greylist: delayed 302 seconds by postgrey-1.27 at vger.kernel.org; Sat, 10 Jun 2017 20:00:28 EDT DomainKey-Signature: a=rsa-sha1; c=nofws; d=patches.alemayhu.com; s=mailo; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id; b=XVs05huYUB/71nnKiUy0721IdEk11cYgrpchIg6PC6LA4cqkpfZnck7XVJBQkHHRxV5gCr ycBpYCGnXtEQ94i4LWhnztsH94J9j8Qkld9DWoQkB57zhnLUMZxrkWHBoAyy262uXa49G7+1 HCcNhDdxM0Rlz/ajfurEeenxT1N1g= X-Mailgun-Sending-Ip: 209.61.151.224 X-Mailgun-Sid: WyJhMWRlZiIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgIjg0ZGFmOSJd From: Alexander Alemayhu To: linux-kernel@vger.kernel.org Cc: rientjes@google.com, torvalds@linux-foundation.org, Alexander Alemayhu Subject: [PATCH] compiler, clang: check before defining inline Date: Sun, 11 Jun 2017 01:55:20 +0200 Message-Id: <1497138920-27052-1-git-send-email-alexander@alemayhu.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2613 Lines: 60 Fixes the compiler warning below introduced in abb2ea7dfd82 (compiler, clang: suppress warning for unused static inline functions, 2017-06-06) ./include/linux/compiler-gcc.h:78:9: note: previous definition is here ^ 1 warning generated. clang -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include -I./arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h \ -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ -Wno-address-of-packed-member -Wno-tautological-compare \ -Wno-unknown-warning-option \ -O2 -emit-llvm -c /home/vagrant/kernels/net-next/samples/bpf/test_map_in_map_kern.c -o -| llc -march=bpf -filetype=obj -o /home/vagrant/kernels/net-next/samples/bpf/test_map_in_map_kern.o In file included from /home/vagrant/kernels/net-next/samples/bpf/test_map_in_map_kern.c:9: In file included from ./include/linux/ptrace.h:4: In file included from ./include/linux/compiler.h:82: ./include/linux/compiler-clang.h:24:9: warning: 'inline' macro redefined [-Wmacro-redefined] ^ ./include/linux/compiler-gcc.h:78:9: note: previous definition is here ^ 1 warning generated. make[1]: Leaving directory '/home/vagrant/kernels/net-next' $ clang --version clang version 3.9.1 (tags/RELEASE_391/final) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin $ gcc --version gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fixes: abb2ea7dfd82 ("compiler, clang: suppress warning for unused static inline functions") Signed-off-by: Alexander Alemayhu --- This is causing an error on out of tree builds for example using the prototype-kernel repository. Should this be sent to Linus? Thanks include/linux/compiler-clang.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index ea9126006a69..7cb55de2703c 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -21,4 +21,6 @@ * -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well. */ +#ifndef inline #define inline inline __attribute__((unused)) +#endif -- 2.7.4