All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6
@ 2015-11-03 11:21 Namhyung Kim
  2015-11-03 15:13 ` Arnaldo Carvalho de Melo
  2015-11-08  7:28 ` [tip:perf/urgent] tools lib bpf: " tip-bot for Namhyung Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Namhyung Kim @ 2015-11-03 11:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern, Wang Nan

    CC       libbpf.o
  cc1: warnings being treated as errors
  libbpf.c: In function 'bpf_program__title':
  libbpf.c:1037: error: declaration of 'dup' shadows a global declaration
  /usr/include/unistd.h:528: error: shadowed declaration is here
  mv: cannot stat `./.libbpf.o.tmp': No such file or directory
  make[3]: *** [libbpf.o] Error 1
  make[2]: *** [libbpf-in.o] Error 2
  make[1]: *** [/linux/tools/lib/bpf/libbpf.a] Error 2
  make[1]: *** Waiting for unfinished jobs....

Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/lib/bpf/libbpf.c | 4 ++--
 tools/lib/bpf/libbpf.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 4252fc22f78f..9f3c8cf9249b 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1034,12 +1034,12 @@ int bpf_program__get_private(struct bpf_program *prog, void **ppriv)
 	return 0;
 }
 
-const char *bpf_program__title(struct bpf_program *prog, bool dup)
+const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
 {
 	const char *title;
 
 	title = prog->section_name;
-	if (dup) {
+	if (needs_copy) {
 		title = strdup(title);
 		if (!title) {
 			pr_warning("failed to strdup program title\n");
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index f16170c95ffd..bc80af03c6f4 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -63,7 +63,7 @@ int bpf_program__set_private(struct bpf_program *prog, void *priv,
 int bpf_program__get_private(struct bpf_program *prog,
 			     void **ppriv);
 
-const char *bpf_program__title(struct bpf_program *prog, bool dup);
+const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
 
 int bpf_program__fd(struct bpf_program *prog);
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6
  2015-11-03 11:21 [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Namhyung Kim
@ 2015-11-03 15:13 ` Arnaldo Carvalho de Melo
  2015-11-08  7:28 ` [tip:perf/urgent] tools lib bpf: " tip-bot for Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-11-03 15:13 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern, Wang Nan

Em Tue, Nov 03, 2015 at 08:21:05PM +0900, Namhyung Kim escreveu:
>     CC       libbpf.o
>   cc1: warnings being treated as errors
>   libbpf.c: In function 'bpf_program__title':
>   libbpf.c:1037: error: declaration of 'dup' shadows a global declaration
>   /usr/include/unistd.h:528: error: shadowed declaration is here
>   mv: cannot stat `./.libbpf.o.tmp': No such file or directory
>   make[3]: *** [libbpf.o] Error 1
>   make[2]: *** [libbpf-in.o] Error 2
>   make[1]: *** [/linux/tools/lib/bpf/libbpf.a] Error 2
>   make[1]: *** Waiting for unfinished jobs....

Thanks, applied.

- Arnaldo
 
> Cc: Wang Nan <wangnan0@huawei.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/lib/bpf/libbpf.c | 4 ++--
>  tools/lib/bpf/libbpf.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 4252fc22f78f..9f3c8cf9249b 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -1034,12 +1034,12 @@ int bpf_program__get_private(struct bpf_program *prog, void **ppriv)
>  	return 0;
>  }
>  
> -const char *bpf_program__title(struct bpf_program *prog, bool dup)
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
>  {
>  	const char *title;
>  
>  	title = prog->section_name;
> -	if (dup) {
> +	if (needs_copy) {
>  		title = strdup(title);
>  		if (!title) {
>  			pr_warning("failed to strdup program title\n");
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index f16170c95ffd..bc80af03c6f4 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -63,7 +63,7 @@ int bpf_program__set_private(struct bpf_program *prog, void *priv,
>  int bpf_program__get_private(struct bpf_program *prog,
>  			     void **ppriv);
>  
> -const char *bpf_program__title(struct bpf_program *prog, bool dup);
> +const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
>  
>  int bpf_program__fd(struct bpf_program *prog);
>  
> -- 
> 2.6.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] tools lib bpf: Fix compiler warning on CentOS 6
  2015-11-03 11:21 [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Namhyung Kim
  2015-11-03 15:13 ` Arnaldo Carvalho de Melo
@ 2015-11-08  7:28 ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Namhyung Kim @ 2015-11-08  7:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, mingo, dsahern, namhyung, tglx, jolsa, linux-kernel,
	wangnan0, hpa, a.p.zijlstra

Commit-ID:  715f8db9102f1ab40ea4a87bedfe86399323698f
Gitweb:     http://git.kernel.org/tip/715f8db9102f1ab40ea4a87bedfe86399323698f
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Tue, 3 Nov 2015 20:21:05 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 3 Nov 2015 12:13:31 -0300

tools lib bpf: Fix compiler warning on CentOS 6

    CC       libbpf.o
  cc1: warnings being treated as errors
  libbpf.c: In function 'bpf_program__title':
  libbpf.c:1037: error: declaration of 'dup' shadows a global declaration
  /usr/include/unistd.h:528: error: shadowed declaration is here
  mv: cannot stat `./.libbpf.o.tmp': No such file or directory
  make[3]: *** [libbpf.o] Error 1
  make[2]: *** [libbpf-in.o] Error 2
  make[1]: *** [/linux/tools/lib/bpf/libbpf.a] Error 2
  make[1]: *** Waiting for unfinished jobs....

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1446549665-2342-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/bpf/libbpf.c | 4 ++--
 tools/lib/bpf/libbpf.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 4252fc2..9f3c8cf 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1034,12 +1034,12 @@ int bpf_program__get_private(struct bpf_program *prog, void **ppriv)
 	return 0;
 }
 
-const char *bpf_program__title(struct bpf_program *prog, bool dup)
+const char *bpf_program__title(struct bpf_program *prog, bool needs_copy)
 {
 	const char *title;
 
 	title = prog->section_name;
-	if (dup) {
+	if (needs_copy) {
 		title = strdup(title);
 		if (!title) {
 			pr_warning("failed to strdup program title\n");
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index f16170c..bc80af0 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -63,7 +63,7 @@ int bpf_program__set_private(struct bpf_program *prog, void *priv,
 int bpf_program__get_private(struct bpf_program *prog,
 			     void **ppriv);
 
-const char *bpf_program__title(struct bpf_program *prog, bool dup);
+const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
 
 int bpf_program__fd(struct bpf_program *prog);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-08  7:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 11:21 [PATCH] tools/lib/bpf: Fix compiler warning on CentOS 6 Namhyung Kim
2015-11-03 15:13 ` Arnaldo Carvalho de Melo
2015-11-08  7:28 ` [tip:perf/urgent] tools lib bpf: " tip-bot for Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.