All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	hpa@zytor.com, jolsa@redhat.com, mingo@kernel.org,
	acme@redhat.com, jolsa@kernel.org, namhyung@kernel.org,
	tglx@linutronix.de, dsahern@gmail.com
Subject: [tip:perf/core] perf tools: Omit unnecessary cast in perf_pmu__parse_scale
Date: Fri, 11 Mar 2016 00:46:51 -0800	[thread overview]
Message-ID: <tip-ea8f75f981918c5946fc4029acdc86707fa901c1@git.kernel.org> (raw)
In-Reply-To: <20160308184230.GB7897@krava.redhat.com>

Commit-ID:  ea8f75f981918c5946fc4029acdc86707fa901c1
Gitweb:     http://git.kernel.org/tip/ea8f75f981918c5946fc4029acdc86707fa901c1
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Tue, 8 Mar 2016 19:42:30 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 9 Mar 2016 10:42:22 -0300

perf tools: Omit unnecessary cast in perf_pmu__parse_scale

There's no need to use a const char pointer, we can used char pointer
from the beginning and omit the unnecessary cast.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160308184230.GB7897@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index d8cd038..adef23b 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -98,7 +98,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *
 	char scale[128];
 	int fd, ret = -1;
 	char path[PATH_MAX];
-	const char *lc;
+	char *lc;
 
 	snprintf(path, PATH_MAX, "%s/%s.scale", dir, name);
 
@@ -146,7 +146,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *
 	/* restore locale */
 	setlocale(LC_NUMERIC, lc);
 
-	free((char *) lc);
+	free(lc);
 
 	ret = 0;
 error:

  parent reply	other threads:[~2016-03-11  8:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 19:21 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-02-29 19:21 ` [PATCH 01/11] perf tools: Fix python extension build Arnaldo Carvalho de Melo
2016-02-29 19:21 ` [PATCH 02/11] perf trace: Check and discard not only 'nr' but also '__syscall_nr' Arnaldo Carvalho de Melo
2016-02-29 19:21 ` [PATCH 03/11] tracing/syscalls: Rename "/format" tracepoint field name "nr" to "__syscall_nr: Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 04/11] tools lib traceevent: Split pevent_print_event() into specific functionality functions Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 05/11] perf stat: Check existence of frontend/backed stalled cycles Arnaldo Carvalho de Melo
2016-03-03  8:28   ` Ingo Molnar
2016-03-03 12:49     ` Arnaldo Carvalho de Melo
2016-03-03 12:50       ` Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 06/11] perf data: Support converting data from bpf_perf_event_output() Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 07/11] perf data: Explicitly set byte order for integer types Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 08/11] perf record: Use WARN_ONCE to replace 'if' condition Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 09/11] perf record: Extract synthesize code to record__synthesize() Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 10/11] perf record: Introduce record__finish_output() to finish a perf.data Arnaldo Carvalho de Melo
2016-02-29 19:22 ` [PATCH 11/11] perf record: Ensure return non-zero rc when mmap fail Arnaldo Carvalho de Melo
2016-03-03  8:21 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar
2016-03-03  9:15   ` Jiri Olsa
2016-03-03  9:53     ` [PATCH] perf tools: Fix locale handling in pmu parsing Jiri Olsa
2016-03-03 16:20       ` Andi Kleen
2016-03-05  8:14       ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-03-08 13:23         ` Ingo Molnar
2016-03-08 18:42           ` [PATCH][perf/core] perf tools: Omit unnecessary cast in perf_pmu__parse_scale Jiri Olsa
2016-03-09 13:43             ` Arnaldo Carvalho de Melo
2016-03-11  8:46             ` tip-bot for Jiri Olsa [this message]
2016-03-03 14:38   ` [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-03-05  8:08     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ea8f75f981918c5946fc4029acdc86707fa901c1@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.