All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/perf/perf.c: Clean up trivial style issues.
@ 2010-01-24 23:21 Thiago Farina
  2010-01-25  0:16 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2010-01-24 23:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Frederic Weisbecker,
	Arnaldo Carvalho de Melo, Masami Hiramatsu

Checked with:
./../scripts/checkpatch.pl --terse --file perf.c

perf.c:51: ERROR: open brace '{' following function declarations go on the next line
perf.c:73: ERROR: "foo*** bar" should be "foo ***bar"
perf.c:112: ERROR: space prohibited before that close parenthesis ')'
perf.c:127: ERROR: space prohibited before that close parenthesis ')'
perf.c:171: ERROR: "foo** bar" should be "foo **bar"
perf.c:213: ERROR: "(foo*)" should be "(foo *)"
perf.c:216: ERROR: "(foo*)" should be "(foo *)"
perf.c:217: ERROR: space required before that '*' (ctx:OxV)
perf.c:452: ERROR: do not initialise statics to 0 or NULL
perf.c:453: ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 tools/perf/perf.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 873e55f..948a8f5 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -48,7 +48,8 @@ int check_pager_config(const char *cmd)
 	return c.val;
 }
 
-static void commit_pager_choice(void) {
+static void commit_pager_choice(void)
+{
 	switch (use_pager) {
 	case 0:
 		setenv("PERF_PAGER", "cat", 1);
@@ -70,7 +71,7 @@ static void set_debugfs_path(void)
 		 "tracing/events");
 }
 
-static int handle_options(const char*** argv, int* argc, int* envchanged)
+static int handle_options(const char ***argv, int *argc, int *envchanged)
 {
 	int handled = 0;
 
@@ -109,7 +110,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--perf-dir")) {
 			if (*argc < 2) {
-				fprintf(stderr, "No directory given for --perf-dir.\n" );
+				fprintf(stderr, "No directory given for --perf-dir.\n");
 				usage(perf_usage_string);
 			}
 			setenv(PERF_DIR_ENVIRONMENT, (*argv)[1], 1);
@@ -124,7 +125,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
 				*envchanged = 1;
 		} else if (!strcmp(cmd, "--work-tree")) {
 			if (*argc < 2) {
-				fprintf(stderr, "No directory given for --work-tree.\n" );
+				fprintf(stderr, "No directory given for --work-tree.\n");
 				usage(perf_usage_string);
 			}
 			setenv(PERF_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
@@ -168,7 +169,7 @@ static int handle_alias(int *argcp, const char ***argv)
 {
 	int envchanged = 0, ret = 0, saved_errno = errno;
 	int count, option_count;
-	const char** new_argv;
+	const char **new_argv;
 	const char *alias_command;
 	char *alias_string;
 
@@ -210,11 +211,11 @@ static int handle_alias(int *argcp, const char ***argv)
 		if (!strcmp(alias_command, new_argv[0]))
 			die("recursive alias: %s", alias_command);
 
-		new_argv = realloc(new_argv, sizeof(char*) *
+		new_argv = realloc(new_argv, sizeof(char *) *
 				    (count + *argcp + 1));
 		/* insert after command name */
-		memcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp);
-		new_argv[count+*argcp] = NULL;
+		memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);
+		new_argv[count + *argcp] = NULL;
 
 		*argv = new_argv;
 		*argcp += count - 1;
@@ -449,8 +450,8 @@ int main(int argc, const char **argv)
 	setup_path();
 
 	while (1) {
-		static int done_help = 0;
-		static int was_alias = 0;
+		static int done_help;
+		static int was_alias;
 
 		was_alias = run_argv(&argc, &argv);
 		if (errno != ENOENT)
-- 
1.6.6.1.436.gaba7d


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

* Re: [PATCH] tools/perf/perf.c: Clean up trivial style issues.
  2010-01-24 23:21 [PATCH] tools/perf/perf.c: Clean up trivial style issues Thiago Farina
@ 2010-01-25  0:16 ` Arnaldo Carvalho de Melo
  2010-01-27 11:59   ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-01-25  0:16 UTC (permalink / raw)
  To: Thiago Farina
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Frederic Weisbecker, Masami Hiramatsu

Em Sun, Jan 24, 2010 at 06:21:46PM -0500, Thiago Farina escreveu:
> Checked with:
> ./../scripts/checkpatch.pl --terse --file perf.c
> 
> perf.c:51: ERROR: open brace '{' following function declarations go on the next line
> perf.c:73: ERROR: "foo*** bar" should be "foo ***bar"
> perf.c:112: ERROR: space prohibited before that close parenthesis ')'
> perf.c:127: ERROR: space prohibited before that close parenthesis ')'
> perf.c:171: ERROR: "foo** bar" should be "foo **bar"
> perf.c:213: ERROR: "(foo*)" should be "(foo *)"
> perf.c:216: ERROR: "(foo*)" should be "(foo *)"
> perf.c:217: ERROR: space required before that '*' (ctx:OxV)
> perf.c:452: ERROR: do not initialise statics to 0 or NULL
> perf.c:453: ERROR: do not initialise statics to 0 or NULL

I'm ok with this, all comes from git lack of checkpatchin', from where
this code was stolen^Wlifted, I guess :-)

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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

* Re: [PATCH] tools/perf/perf.c: Clean up trivial style issues.
  2010-01-25  0:16 ` Arnaldo Carvalho de Melo
@ 2010-01-27 11:59   ` Ingo Molnar
  2010-01-27 12:44     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2010-01-27 11:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Thiago Farina, linux-kernel, Peter Zijlstra, Paul Mackerras,
	Frederic Weisbecker, Masami Hiramatsu


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Em Sun, Jan 24, 2010 at 06:21:46PM -0500, Thiago Farina escreveu:
> > Checked with:
> > ./../scripts/checkpatch.pl --terse --file perf.c
> > 
> > perf.c:51: ERROR: open brace '{' following function declarations go on the next line
> > perf.c:73: ERROR: "foo*** bar" should be "foo ***bar"
> > perf.c:112: ERROR: space prohibited before that close parenthesis ')'
> > perf.c:127: ERROR: space prohibited before that close parenthesis ')'
> > perf.c:171: ERROR: "foo** bar" should be "foo **bar"
> > perf.c:213: ERROR: "(foo*)" should be "(foo *)"
> > perf.c:216: ERROR: "(foo*)" should be "(foo *)"
> > perf.c:217: ERROR: space required before that '*' (ctx:OxV)
> > perf.c:452: ERROR: do not initialise statics to 0 or NULL
> > perf.c:453: ERROR: do not initialise statics to 0 or NULL
> 
> I'm ok with this, all comes from git lack of checkpatchin', from where
> this code was stolen^Wlifted, I guess :-)
> 
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Mind picking it up into your tree and sending it to me with your next series 
of patches?

Thanks,

	Ingo

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

* Re: [PATCH] tools/perf/perf.c: Clean up trivial style issues.
  2010-01-27 11:59   ` Ingo Molnar
@ 2010-01-27 12:44     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-01-27 12:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Thiago Farina, linux-kernel, Peter Zijlstra, Paul Mackerras,
	Frederic Weisbecker, Masami Hiramatsu

Em Wed, Jan 27, 2010 at 12:59:42PM +0100, Ingo Molnar escreveu:
> 
> * Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> 
> > Em Sun, Jan 24, 2010 at 06:21:46PM -0500, Thiago Farina escreveu:
> > > Checked with:
> > > ./../scripts/checkpatch.pl --terse --file perf.c
> > > 
> > > perf.c:51: ERROR: open brace '{' following function declarations go on the next line
> > > perf.c:73: ERROR: "foo*** bar" should be "foo ***bar"
> > > perf.c:112: ERROR: space prohibited before that close parenthesis ')'
> > > perf.c:127: ERROR: space prohibited before that close parenthesis ')'
> > > perf.c:171: ERROR: "foo** bar" should be "foo **bar"
> > > perf.c:213: ERROR: "(foo*)" should be "(foo *)"
> > > perf.c:216: ERROR: "(foo*)" should be "(foo *)"
> > > perf.c:217: ERROR: space required before that '*' (ctx:OxV)
> > > perf.c:452: ERROR: do not initialise statics to 0 or NULL
> > > perf.c:453: ERROR: do not initialise statics to 0 or NULL
> > 
> > I'm ok with this, all comes from git lack of checkpatchin', from where
> > this code was stolen^Wlifted, I guess :-)
> > 
> > Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Mind picking it up into your tree and sending it to me with your next series 
> of patches?

Sure thing.

- Arnaldo

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

end of thread, other threads:[~2010-01-27 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-24 23:21 [PATCH] tools/perf/perf.c: Clean up trivial style issues Thiago Farina
2010-01-25  0:16 ` Arnaldo Carvalho de Melo
2010-01-27 11:59   ` Ingo Molnar
2010-01-27 12:44     ` Arnaldo Carvalho de Melo

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.