diff mbox series

[bpf-next] libbpf: remove compile time warning from libbpf_util.h

Message ID 1555572070-30796-1-git-send-email-magnus.karlsson@intel.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] libbpf: remove compile time warning from libbpf_util.h | expand

Commit Message

Magnus Karlsson April 18, 2019, 7:21 a.m. UTC
Having a helpful compile time warning in libbpf_util.h is not a good
idea since all warnings are treated as errors. Change this into a
comment in the code instead.

Fixes: b7e3a28019c9 ("libbpf: remove dependency on barrier.h in xsk.h")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
 tools/lib/bpf/libbpf_util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Y Song April 18, 2019, 8:58 p.m. UTC | #1
On Thu, Apr 18, 2019 at 12:23 AM Magnus Karlsson
<magnus.karlsson@intel.com> wrote:
>
> Having a helpful compile time warning in libbpf_util.h is not a good
> idea since all warnings are treated as errors. Change this into a
> comment in the code instead.
>
> Fixes: b7e3a28019c9 ("libbpf: remove dependency on barrier.h in xsk.h")
> Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>

Acked-by: Yonghong Song <yhs@fb.com>


> ---
>  tools/lib/bpf/libbpf_util.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/libbpf_util.h b/tools/lib/bpf/libbpf_util.h
> index 172b707e..da94c4c 100644
> --- a/tools/lib/bpf/libbpf_util.h
> +++ b/tools/lib/bpf/libbpf_util.h
> @@ -46,7 +46,7 @@ do {                          \
>  # define libbpf_smp_mb() asm volatile("dmb ish" : : : "memory")
>  # define libbpf_smp_rwmb() libbpf_smp_mb()
>  #else
> -# warning Architecture missing native barrier functions in libbpf_util.h.
> +/* Architecture missing native barrier functions. */
>  # define libbpf_smp_rmb() __sync_synchronize()
>  # define libbpf_smp_wmb() __sync_synchronize()
>  # define libbpf_smp_mb() __sync_synchronize()
> --
> 2.7.4
>
Alexei Starovoitov April 18, 2019, 11:07 p.m. UTC | #2
On Thu, Apr 18, 2019 at 12:21 AM Magnus Karlsson
<magnus.karlsson@intel.com> wrote:
>
> Having a helpful compile time warning in libbpf_util.h is not a good
> idea since all warnings are treated as errors. Change this into a
> comment in the code instead.
>
> Fixes: b7e3a28019c9 ("libbpf: remove dependency on barrier.h in xsk.h")
> Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>

Applied. Thanks
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf_util.h b/tools/lib/bpf/libbpf_util.h
index 172b707e..da94c4c 100644
--- a/tools/lib/bpf/libbpf_util.h
+++ b/tools/lib/bpf/libbpf_util.h
@@ -46,7 +46,7 @@  do {				\
 # define libbpf_smp_mb() asm volatile("dmb ish" : : : "memory")
 # define libbpf_smp_rwmb() libbpf_smp_mb()
 #else
-# warning Architecture missing native barrier functions in libbpf_util.h.
+/* Architecture missing native barrier functions. */
 # define libbpf_smp_rmb() __sync_synchronize()
 # define libbpf_smp_wmb() __sync_synchronize()
 # define libbpf_smp_mb() __sync_synchronize()