diff mbox series

perf symbols: Remove unused variable 'err'

Message ID 20190530093801.20510-1-leo.yan@linaro.org
State Accepted
Commit e5f177a578edf4501d0758bfa922cd0b0f9d0e9d
Headers show
Series perf symbols: Remove unused variable 'err' | expand

Commit Message

Leo Yan May 30, 2019, 9:38 a.m. UTC
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(-)

-- 
2.17.1

Comments

Arnaldo Carvalho de Melo May 30, 2019, 12:43 p.m. UTC | #1
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
Leo Yan May 30, 2019, 12:58 p.m. UTC | #2
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.
diff mbox series

Patch

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;
 }
 
 /**