All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf x86: Fix compile of util/tsc.c
@ 2013-07-26 14:27 David Ahern
  2013-08-05  8:34 ` Adrian Hunter
  2013-08-12 10:18 ` [tip:perf/core] perf tools: " tip-bot for David Ahern
  0 siblings, 2 replies; 4+ messages in thread
From: David Ahern @ 2013-07-26 14:27 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Adrian Hunter

On Fedora 18, with gcc 4.6.4 compile fails with:

arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/arch/x86/util/tsc.o] Error 1
make: *** Waiting for unfinished jobs....

Fix by renaming the local variable.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/arch/x86/util/tsc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index f111744..9570c2b 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -10,11 +10,11 @@
 
 u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
 {
-	u64 time, quot, rem;
+	u64 t, quot, rem;
 
-	time = ns - tc->time_zero;
-	quot = time / tc->time_mult;
-	rem  = time % tc->time_mult;
+	t = ns - tc->time_zero;
+	quot = t / tc->time_mult;
+	rem  = t % tc->time_mult;
 	return (quot << tc->time_shift) +
 	       (rem << tc->time_shift) / tc->time_mult;
 }
-- 
1.7.10.1


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

* Re: [PATCH] perf x86: Fix compile of util/tsc.c
  2013-07-26 14:27 [PATCH] perf x86: Fix compile of util/tsc.c David Ahern
@ 2013-08-05  8:34 ` Adrian Hunter
  2013-08-05  8:35   ` Jiri Olsa
  2013-08-12 10:18 ` [tip:perf/core] perf tools: " tip-bot for David Ahern
  1 sibling, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2013-08-05  8:34 UTC (permalink / raw)
  To: David Ahern; +Cc: acme, linux-kernel, Jiri Olsa

On 26/07/13 17:27, David Ahern wrote:
> On Fedora 18, with gcc 4.6.4 compile fails with:
> 
> arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
> arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
> cc1: all warnings being treated as errors
> make: *** [/tmp/junk/arch/x86/util/tsc.o] Error 1
> make: *** Waiting for unfinished jobs....
> 
> Fix by renaming the local variable.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/arch/x86/util/tsc.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
> index f111744..9570c2b 100644
> --- a/tools/perf/arch/x86/util/tsc.c
> +++ b/tools/perf/arch/x86/util/tsc.c
> @@ -10,11 +10,11 @@
>  
>  u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
>  {
> -	u64 time, quot, rem;
> +	u64 t, quot, rem;
>  
> -	time = ns - tc->time_zero;
> -	quot = time / tc->time_mult;
> -	rem  = time % tc->time_mult;
> +	t = ns - tc->time_zero;
> +	quot = t / tc->time_mult;
> +	rem  = t % tc->time_mult;
>  	return (quot << tc->time_shift) +
>  	       (rem << tc->time_shift) / tc->time_mult;
>  }
> 


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

* Re: [PATCH] perf x86: Fix compile of util/tsc.c
  2013-08-05  8:34 ` Adrian Hunter
@ 2013-08-05  8:35   ` Jiri Olsa
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2013-08-05  8:35 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: David Ahern, acme, linux-kernel

On Mon, Aug 05, 2013 at 11:34:57AM +0300, Adrian Hunter wrote:
> On 26/07/13 17:27, David Ahern wrote:
> > On Fedora 18, with gcc 4.6.4 compile fails with:
> > 
> > arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
> > arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
> > cc1: all warnings being treated as errors
> > make: *** [/tmp/junk/arch/x86/util/tsc.o] Error 1
> > make: *** Waiting for unfinished jobs....
> > 
> > Fix by renaming the local variable.
> > 
> > Signed-off-by: David Ahern <dsahern@gmail.com>
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> 
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>

Acked-by: Jiri Olsa <jolsa@redhat.com>

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

* [tip:perf/core] perf tools: Fix compile of util/tsc.c
  2013-07-26 14:27 [PATCH] perf x86: Fix compile of util/tsc.c David Ahern
  2013-08-05  8:34 ` Adrian Hunter
@ 2013-08-12 10:18 ` tip-bot for David Ahern
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for David Ahern @ 2013-08-12 10:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, hpa, mingo, adrian.hunter, dsahern, tglx

Commit-ID:  602bab1b883090ffd125ed1253fe8ec127c048b1
Gitweb:     http://git.kernel.org/tip/602bab1b883090ffd125ed1253fe8ec127c048b1
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Fri, 26 Jul 2013 08:27:23 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Aug 2013 17:35:24 -0300

perf tools: Fix compile of util/tsc.c

On Fedora 18, with gcc 4.6.4 compile fails with:

arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/arch/x86/util/tsc.o] Error 1
make: *** Waiting for unfinished jobs....

Fix by renaming the local variable.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Link: http://lkml.kernel.org/r/1374848843-43127-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/tsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index f111744..9570c2b 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -10,11 +10,11 @@
 
 u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
 {
-	u64 time, quot, rem;
+	u64 t, quot, rem;
 
-	time = ns - tc->time_zero;
-	quot = time / tc->time_mult;
-	rem  = time % tc->time_mult;
+	t = ns - tc->time_zero;
+	quot = t / tc->time_mult;
+	rem  = t % tc->time_mult;
 	return (quot << tc->time_shift) +
 	       (rem << tc->time_shift) / tc->time_mult;
 }

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

end of thread, other threads:[~2013-08-12 10:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 14:27 [PATCH] perf x86: Fix compile of util/tsc.c David Ahern
2013-08-05  8:34 ` Adrian Hunter
2013-08-05  8:35   ` Jiri Olsa
2013-08-12 10:18 ` [tip:perf/core] perf tools: " tip-bot for David Ahern

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.