* [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv()
@ 2018-12-29 14:17 Mattias Jacobsson
2019-01-04 15:48 ` Arnaldo Carvalho de Melo
2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson
0 siblings, 2 replies; 3+ messages in thread
From: Mattias Jacobsson @ 2018-12-29 14:17 UTC (permalink / raw)
To: peterz, mingo, acme; +Cc: sansharm, linux-kernel, 2pi
Each call to va_copy() should have one, and only one, corresponding call
to va_end(). In strbuf_addv() some code paths result in va_end() getting
called multiple times. Remove the superfluous va_end().
Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
---
tools/perf/util/strbuf.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index 9005fbe0780e..23092fd6451d 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -109,7 +109,6 @@ static int strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
return ret;
}
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);
- va_end(ap_saved);
if (len > strbuf_avail(sb)) {
pr_debug("this should not happen, your vsnprintf is broken");
va_end(ap_saved);
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv()
2018-12-29 14:17 [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv() Mattias Jacobsson
@ 2019-01-04 15:48 ` Arnaldo Carvalho de Melo
2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-01-04 15:48 UTC (permalink / raw)
To: Mattias Jacobsson; +Cc: peterz, mingo, sansharm, linux-kernel, Jiri Olsa
Em Sat, Dec 29, 2018 at 03:17:50PM +0100, Mattias Jacobsson escreveu:
> Each call to va_copy() should have one, and only one, corresponding call
> to va_end(). In strbuf_addv() some code paths result in va_end() getting
> called multiple times. Remove the superfluous va_end().
>
> Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
> Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Its nice that you included the Fixes tag!
Thanks, applied.
- Arnaldo
> ---
> tools/perf/util/strbuf.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
> index 9005fbe0780e..23092fd6451d 100644
> --- a/tools/perf/util/strbuf.c
> +++ b/tools/perf/util/strbuf.c
> @@ -109,7 +109,6 @@ static int strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
> return ret;
> }
> len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);
> - va_end(ap_saved);
> if (len > strbuf_avail(sb)) {
> pr_debug("this should not happen, your vsnprintf is broken");
> va_end(ap_saved);
> --
> 2.20.1
--
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf strbuf: Remove redundant va_end() in strbuf_addv()
2018-12-29 14:17 [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv() Mattias Jacobsson
2019-01-04 15:48 ` Arnaldo Carvalho de Melo
@ 2019-01-08 15:44 ` tip-bot for Mattias Jacobsson
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Mattias Jacobsson @ 2019-01-08 15:44 UTC (permalink / raw)
To: linux-tip-commits
Cc: sansharm, jolsa, hpa, mingo, 2pi, tglx, linux-kernel, acme, peterz
Commit-ID: 099be748865eece21362aee416c350c0b1ae34df
Gitweb: https://git.kernel.org/tip/099be748865eece21362aee416c350c0b1ae34df
Author: Mattias Jacobsson <2pi@mok.nu>
AuthorDate: Sat, 29 Dec 2018 15:17:50 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 4 Jan 2019 12:54:49 -0300
perf strbuf: Remove redundant va_end() in strbuf_addv()
Each call to va_copy() should have one, and only one, corresponding call
to va_end(). In strbuf_addv() some code paths result in va_end() getting
called multiple times. Remove the superfluous va_end().
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sanskriti Sharma <sansharm@redhat.com>
Link: http://lkml.kernel.org/r/20181229141750.16945-1-2pi@mok.nu
Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/strbuf.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index 9005fbe0780e..23092fd6451d 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -109,7 +109,6 @@ static int strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap)
return ret;
}
len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);
- va_end(ap_saved);
if (len > strbuf_avail(sb)) {
pr_debug("this should not happen, your vsnprintf is broken");
va_end(ap_saved);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-08 15:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 14:17 [PATCH] perf tools: util: remove redundant va_end() in strbuf_addv() Mattias Jacobsson
2019-01-04 15:48 ` Arnaldo Carvalho de Melo
2019-01-08 15:44 ` [tip:perf/urgent] perf strbuf: Remove " tip-bot for Mattias Jacobsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).