lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 15 Dec 2016 12:29:27 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Alexei Starovoitov <ast@...com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Wang Nan <wangnan0@...wei.com>, Joe Stringer <joe@....org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] sample/bpf: Make perf_event_read() static


While testing Joe's conversion of samples/bpf/ to use tools/lib/bpf/ I
noticed some warnings, do you guys mind if I put patches like the one
below in my tree, pushing to Ingo soon?

Or is there anything subtle against doing so?


----

While building samples/bpf/ on a Fedora Rawhide container, with
clang/llvm 3.9 I noticed this:

root@...97fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
make[1]: Entering directory '/tmp/build/linux'
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /git/linux as source for kernel
<SNIP>
  HOSTCC  samples/bpf/trace_output_user.o
/git/linux/samples/bpf/trace_output_user.c:64:6: warning: no previous
prototype for 'perf_event_read' [-Wmissing-prototypes]
 void perf_event_read(print_fn fn)
      ^~~~~~~~~~~~~~~
  HOSTLD  samples/bpf/trace_output
make[1]: Leaving directory '/tmp/build/linux'

Shutup the compiler by setting that function as static.

Cc: Alexei Starovoitov <ast@...com>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Wang Nan <wangnan0@...wei.com>,
Cc: Joe Stringer <joe@....org>
Link: http://lkml.kernel.org/n/tip-2wkr4ymwhdie0stbkbiyplt5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>

--

diff --git a/samples/bpf/trace_output_user.c b/samples/bpf/trace_output_user.c
index 3bedd945def1..1a1da7bddb93 100644
--- a/samples/bpf/trace_output_user.c
+++ b/samples/bpf/trace_output_user.c
@@ -61,7 +61,7 @@ struct perf_event_sample {
 	char data[];
 };
 
-void perf_event_read(print_fn fn)
+static void perf_event_read(print_fn fn)
 {
 	__u64 data_tail = header->data_tail;
 	__u64 data_head = header->data_head;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ