All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf symbols: Remove unused variable 'err'
@ 2019-05-30  9:38 Leo Yan
  2019-05-30 12:43 ` Arnaldo Carvalho de Melo
  2019-06-17 18:57 ` [tip:perf/core] " tip-bot for Leo Yan
  0 siblings, 2 replies; 4+ messages in thread
From: Leo Yan @ 2019-05-30  9:38 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Peter Zijlstra, Ingo Molnar, linux-kernel
  Cc: Leo Yan

Variable 'err' is defined but never used in function symsrc__init(),
remove it and directly return -1 at the end of the function.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 tools/perf/util/symbol-elf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 4ad106a5f2c0..fdc5bd7dbb90 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -699,7 +699,6 @@ bool __weak elf__needs_adjust_symbols(GElf_Ehdr ehdr)
 int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 		 enum dso_binary_type type)
 {
-	int err = -1;
 	GElf_Ehdr ehdr;
 	Elf *elf;
 	int fd;
@@ -793,7 +792,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 	elf_end(elf);
 out_close:
 	close(fd);
-	return err;
+	return -1;
 }
 
 /**
-- 
2.17.1


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

* Re: [PATCH] perf symbols: Remove unused variable 'err'
  2019-05-30  9:38 [PATCH] perf symbols: Remove unused variable 'err' Leo Yan
@ 2019-05-30 12:43 ` Arnaldo Carvalho de Melo
  2019-05-30 12:58   ` Leo Yan
  2019-06-17 18:57 ` [tip:perf/core] " tip-bot for Leo Yan
  1 sibling, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-05-30 12:43 UTC (permalink / raw)
  To: Leo Yan
  Cc: Alexander Shishkin, Jiri Olsa, Namhyung Kim, Peter Zijlstra,
	Ingo Molnar, linux-kernel

Em Thu, May 30, 2019 at 05:38:01PM +0800, Leo Yan escreveu:
> Variable 'err' is defined but never used in function symsrc__init(),
> remove it and directly return -1 at the end of the function.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  tools/perf/util/symbol-elf.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index 4ad106a5f2c0..fdc5bd7dbb90 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -699,7 +699,6 @@ bool __weak elf__needs_adjust_symbols(GElf_Ehdr ehdr)
>  int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
>  		 enum dso_binary_type type)
>  {
> -	int err = -1;
>  	GElf_Ehdr ehdr;
>  	Elf *elf;
>  	int fd;
> @@ -793,7 +792,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
>  	elf_end(elf);
>  out_close:
>  	close(fd);
> -	return err;
> +	return -1;
>  }
>  
>  /**
> -- 
> 2.17.1

-- 

- Arnaldo

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

* Re: [PATCH] perf symbols: Remove unused variable 'err'
  2019-05-30 12:43 ` Arnaldo Carvalho de Melo
@ 2019-05-30 12:58   ` Leo Yan
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Yan @ 2019-05-30 12:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Alexander Shishkin, Jiri Olsa, Namhyung Kim, Peter Zijlstra,
	Ingo Molnar, linux-kernel

On Thu, May 30, 2019 at 09:43:02AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, May 30, 2019 at 05:38:01PM +0800, Leo Yan escreveu:
> > Variable 'err' is defined but never used in function symsrc__init(),
> > remove it and directly return -1 at the end of the function.
> 
> Thanks, applied.

Thanks, Arnaldo.

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

* [tip:perf/core] perf symbols: Remove unused variable 'err'
  2019-05-30  9:38 [PATCH] perf symbols: Remove unused variable 'err' Leo Yan
  2019-05-30 12:43 ` Arnaldo Carvalho de Melo
@ 2019-06-17 18:57 ` tip-bot for Leo Yan
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Leo Yan @ 2019-06-17 18:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, leo.yan, linux-kernel, acme, alexander.shishkin, tglx,
	mingo, hpa, peterz, jolsa

Commit-ID:  e5f177a578edf4501d0758bfa922cd0b0f9d0e9d
Gitweb:     https://git.kernel.org/tip/e5f177a578edf4501d0758bfa922cd0b0f9d0e9d
Author:     Leo Yan <leo.yan@linaro.org>
AuthorDate: Thu, 30 May 2019 17:38:01 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 5 Jun 2019 09:47:54 -0300

perf symbols: Remove unused variable 'err'

Variable 'err' is defined but never used in function symsrc__init(),
remove it and directly return -1 at the end of the function.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190530093801.20510-1-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol-elf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 4ad106a5f2c0..fdc5bd7dbb90 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -699,7 +699,6 @@ bool __weak elf__needs_adjust_symbols(GElf_Ehdr ehdr)
 int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 		 enum dso_binary_type type)
 {
-	int err = -1;
 	GElf_Ehdr ehdr;
 	Elf *elf;
 	int fd;
@@ -793,7 +792,7 @@ out_elf_end:
 	elf_end(elf);
 out_close:
 	close(fd);
-	return err;
+	return -1;
 }
 
 /**

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

end of thread, other threads:[~2019-06-17 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30  9:38 [PATCH] perf symbols: Remove unused variable 'err' Leo Yan
2019-05-30 12:43 ` Arnaldo Carvalho de Melo
2019-05-30 12:58   ` Leo Yan
2019-06-17 18:57 ` [tip:perf/core] " tip-bot for Leo Yan

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.