Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565055 > unrolled thread

[PATCH 2/4] perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-01-23 16:30 +0100
Last post2017-01-26 16:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] perf probe: Delete an unnecessary assignment in  try_to_find_absolute_address() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-23 16:30 +0100
    Re: [PATCH 2/4] perf probe: Delete an unnecessary assignment in  try_to_find_absolute_address() Masami Hiramatsu <mhiramat@kernel.org> - 2017-01-23 23:50 +0100
    [tip:perf/core] perf probe: Delete an unnecessary assignment in  try_to_find_absolute_address() tip-bot for Markus Elfring <tipbot@zytor.com> - 2017-01-26 16:40 +0100

#1565055 — [PATCH 2/4] perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-01-23 16:30 +0100
Subject[PATCH 2/4] perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()
Message-ID<t2OJc-885-19@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 23 Jan 2017 15:10:19 +0100

Remove an error code assignment which is redundant in an if branch for
the handling of a memory allocation failure because the same value was set
for the local variable "err" before.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 tools/perf/util/probe-event.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 6c7508337fe8..5a34c93b818a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2956,10 +2956,9 @@ static int try_to_find_absolute_address(struct perf_probe_event *pev,
 
 	tev->nargs = pev->nargs;
 	tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs);
-	if (!tev->args) {
-		err = -ENOMEM;
+	if (!tev->args)
 		goto errout;
-	}
+
 	for (i = 0; i < tev->nargs; i++)
 		copy_to_probe_trace_arg(&tev->args[i], &pev->args[i]);
 
-- 
2.11.0

[toc] | [next] | [standalone]


#1565344

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-01-23 23:50 +0100
Message-ID<t2VAZ-43P-13@gated-at.bofh.it>
In reply to#1565055
On Mon, 23 Jan 2017 16:24:06 +0100
SF Markus Elfring <elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 23 Jan 2017 15:10:19 +0100
> 
> Remove an error code assignment which is redundant in an if branch for
> the handling of a memory allocation failure because the same value was set
> for the local variable "err" before.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>


This looks good to me :)

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> ---
>  tools/perf/util/probe-event.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 6c7508337fe8..5a34c93b818a 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -2956,10 +2956,9 @@ static int try_to_find_absolute_address(struct perf_probe_event *pev,
>  
>  	tev->nargs = pev->nargs;
>  	tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs);
> -	if (!tev->args) {
> -		err = -ENOMEM;
> +	if (!tev->args)
>  		goto errout;
> -	}
> +
>  	for (i = 0; i < tev->nargs; i++)
>  		copy_to_probe_trace_arg(&tev->args[i], &pev->args[i]);
>  
> -- 
> 2.11.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1567524 — [tip:perf/core] perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()

Fromtip-bot for Markus Elfring <tipbot@zytor.com>
Date2017-01-26 16:40 +0100
Subject[tip:perf/core] perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()
Message-ID<t3Ujv-Eh-3@gated-at.bofh.it>
In reply to#1565055
Commit-ID:  d1d0e29cb7d03a6019caa125e4c0288366a4f359
Gitweb:     http://git.kernel.org/tip/d1d0e29cb7d03a6019caa125e4c0288366a4f359
Author:     Markus Elfring <elfring@users.sourceforge.net>
AuthorDate: Mon, 23 Jan 2017 15:10:19 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 26 Jan 2017 11:42:56 -0300

perf probe: Delete an unnecessary assignment in try_to_find_absolute_address()

Remove an error code assignment which is redundant in an if branch for
the handling of a memory allocation failure because the same value was
set for the local variable "err" before.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/0ede09ec-79b6-c8bd-5b20-02c63ed98aab@users.sourceforge.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index cdfc468..ded1e7d 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2994,10 +2994,9 @@ static int try_to_find_absolute_address(struct perf_probe_event *pev,
 
 	tev->nargs = pev->nargs;
 	tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs);
-	if (!tev->args) {
-		err = -ENOMEM;
+	if (!tev->args)
 		goto errout;
-	}
+
 	for (i = 0; i < tev->nargs; i++)
 		copy_to_probe_trace_arg(&tev->args[i], &pev->args[i]);
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web