All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]x86-tsc.c : fix compile warning
@ 2009-06-17 13:57 Figo.zhang
       [not found] ` <bb33bcf20906170700i4a4ea802yf1da08e9870d6221@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Figo.zhang @ 2009-06-17 13:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: lkml

fix compile warning:
arch/x86/kernel/tsc.c: In function ‘time_cpufreq_notifier’:
arch/x86/kernel/tsc.c:635: warning: ‘dummy’ may be used uninitialized in
this function

Signed-off-by: Figo.zhang <figo1802@gmail.com>
---  
arch/x86/kernel/tsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ae3180c..e65492a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -632,7 +632,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 				void *data)
 {
 	struct cpufreq_freqs *freq = data;
-	unsigned long *lpj, dummy;
+	unsigned long *lpj, dummy = 0;
 
 	if (cpu_has(&cpu_data(freq->cpu), X86_FEATURE_CONSTANT_TSC))
 		return 0;



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

* Re: [PATCH]x86-tsc.c : fix compile warning
       [not found] ` <bb33bcf20906170700i4a4ea802yf1da08e9870d6221@mail.gmail.com>
@ 2009-06-17 14:17   ` Subrata Modak
  2009-06-17 14:20     ` Figo.zhang
  2009-06-17 15:28     ` Ingo Molnar
  0 siblings, 2 replies; 10+ messages in thread
From: Subrata Modak @ 2009-06-17 14:17 UTC (permalink / raw)
  To: Figo.zhang
  Cc: Ingo Molnar, lkml, Sumit Panchasara, 'Sachin P Sant',
	'H. Peter Anvin', 'Frans Pop',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh'

> fix compile warning:
> arch/x86/kernel/tsc.c: In function ‘time_cpufreq_notifier’:
> arch/x86/kernel/tsc.c:635: warning: ‘dummy’ may be used uninitialized in
> this function
> 
> Signed-off-by: Figo.zhang <figo1802@gmail.com>

Hello Figo,

Please refer to the following links on discussion on this issue earlier:
http://lkml.org/lkml/2009/5/19/312
http://lkml.org/lkml/2009/5/19/301
http://lkml.org/lkml/2009/5/20/23

I tried to fix it in some other way.

Regards--
Subrata

> ---
> arch/x86/kernel/tsc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index ae3180c..e65492a 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -632,7 +632,7 @@ static int time_cpufreq_notifier(struct
> notifier_block *nb, unsigned long val,
>                                void *data)
>  {
>        struct cpufreq_freqs *freq = data;
> -       unsigned long *lpj, dummy;
> +       unsigned long *lpj, dummy = 0;
> 
>        if (cpu_has(&cpu_data(freq->cpu), X86_FEATURE_CONSTANT_TSC))
>                return 0;
> 



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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 14:17   ` Subrata Modak
@ 2009-06-17 14:20     ` Figo.zhang
  2009-06-17 15:28     ` Ingo Molnar
  1 sibling, 0 replies; 10+ messages in thread
From: Figo.zhang @ 2009-06-17 14:20 UTC (permalink / raw)
  To: subrata
  Cc: Ingo Molnar, lkml, Sumit Panchasara, 'Sachin P Sant',
	'H. Peter Anvin', 'Frans Pop',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh'

On Wed, 2009-06-17 at 19:47 +0530, Subrata Modak wrote:
> > fix compile warning:
> > arch/x86/kernel/tsc.c: In function ‘time_cpufreq_notifier’:
> > arch/x86/kernel/tsc.c:635: warning: ‘dummy’ may be used uninitialized in
> > this function
> > 
> > Signed-off-by: Figo.zhang <figo1802@gmail.com>
> 
> Hello Figo,
> 
> Please refer to the following links on discussion on this issue earlier:
> http://lkml.org/lkml/2009/5/19/312
> http://lkml.org/lkml/2009/5/19/301
> http://lkml.org/lkml/2009/5/20/23
> 
> I tried to fix it in some other way.

hi Subrata,

That is ok.

Best Regards,
Figo.zhang
> 
> Regards--
> Subrata
> 
> > ---
> > arch/x86/kernel/tsc.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> > index ae3180c..e65492a 100644
> > --- a/arch/x86/kernel/tsc.c
> > +++ b/arch/x86/kernel/tsc.c
> > @@ -632,7 +632,7 @@ static int time_cpufreq_notifier(struct
> > notifier_block *nb, unsigned long val,
> >                                void *data)
> >  {
> >        struct cpufreq_freqs *freq = data;
> > -       unsigned long *lpj, dummy;
> > +       unsigned long *lpj, dummy = 0;
> > 
> >        if (cpu_has(&cpu_data(freq->cpu), X86_FEATURE_CONSTANT_TSC))
> >                return 0;
> > 
> 
> 


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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 14:17   ` Subrata Modak
  2009-06-17 14:20     ` Figo.zhang
@ 2009-06-17 15:28     ` Ingo Molnar
  2009-06-17 16:11       ` Subrata Modak
  2009-06-17 16:12       ` Frans Pop
  1 sibling, 2 replies; 10+ messages in thread
From: Ingo Molnar @ 2009-06-17 15:28 UTC (permalink / raw)
  To: Subrata Modak
  Cc: Figo.zhang, lkml, Sumit Panchasara, 'Sachin P Sant',
	'H. Peter Anvin', 'Frans Pop',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh',
	Jaswinder Singh Rajput


* Subrata Modak <subrata@linux.vnet.ibm.com> wrote:

> > fix compile warning:
> > arch/x86/kernel/tsc.c: In function ‘time_cpufreq_notifier’:
> > arch/x86/kernel/tsc.c:635: warning: ‘dummy’ may be used uninitialized in
> > this function
> > 
> > Signed-off-by: Figo.zhang <figo1802@gmail.com>
> 
> Hello Figo,
> 
> Please refer to the following links on discussion on this issue earlier:
> http://lkml.org/lkml/2009/5/19/312
> http://lkml.org/lkml/2009/5/19/301
> http://lkml.org/lkml/2009/5/20/23
> 
> I tried to fix it in some other way.

Ah, and you fixed in what a superior way: you improved the code in 
the process :-) This is how warnings should be fixed really.

Applied.

We apparently missed it when you sent it in May - generally feel 
free to re-send patches if you dont see a commit notification within 
a few days.

Thanks,

	Ingo

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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 15:28     ` Ingo Molnar
@ 2009-06-17 16:11       ` Subrata Modak
  2009-06-17 16:12       ` Frans Pop
  1 sibling, 0 replies; 10+ messages in thread
From: Subrata Modak @ 2009-06-17 16:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Figo.zhang, lkml, Sumit Panchasara, 'Sachin P Sant',
	'H. Peter Anvin', 'Frans Pop',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh',
	Jaswinder Singh Rajput

On Wed, 2009-06-17 at 17:28 +0200, Ingo Molnar wrote:
> * Subrata Modak <subrata@linux.vnet.ibm.com> wrote:
> 
> > > fix compile warning:
> > > arch/x86/kernel/tsc.c: In function ‘time_cpufreq_notifier’:
> > > arch/x86/kernel/tsc.c:635: warning: ‘dummy’ may be used uninitialized in
> > > this function
> > > 
> > > Signed-off-by: Figo.zhang <figo1802@gmail.com>
> > 
> > Hello Figo,
> > 
> > Please refer to the following links on discussion on this issue earlier:
> > http://lkml.org/lkml/2009/5/19/312
> > http://lkml.org/lkml/2009/5/19/301
> > http://lkml.org/lkml/2009/5/20/23
> > 
> > I tried to fix it in some other way.
> 
> Ah, and you fixed in what a superior way: you improved the code in 
> the process :-) This is how warnings should be fixed really.

Thanks Ingo. I would do whenever i find again one.

> 
> Applied.
> 
> We apparently missed it when you sent it in May - generally feel 
> free to re-send patches if you dont see a commit notification within 
> a few days.

My mistake. I did not keep track.

Regards--
Subrata

> 
> Thanks,
> 
> 	Ingo


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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 15:28     ` Ingo Molnar
  2009-06-17 16:11       ` Subrata Modak
@ 2009-06-17 16:12       ` Frans Pop
  2009-06-17 16:23         ` Ingo Molnar
  1 sibling, 1 reply; 10+ messages in thread
From: Frans Pop @ 2009-06-17 16:12 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Subrata Modak, Figo.zhang, lkml, Sumit Panchasara,
	'Sachin P Sant', 'H. Peter Anvin',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh',
	Jaswinder Singh Rajput

On Wednesday 17 June 2009, Ingo Molnar wrote:
> Ah, and you fixed in what a superior way: you improved the code in
> the process :-) This is how warnings should be fixed really.

Hmm. Did you also see Pavel's reply to that patch [1]:
! But that's a bug to be fixed, I'd say? ... actually I believe you are
! introducing a bug here. Yes, old code would put random numbers in
! loops_per_jiffy_ref for !CPUFREQ_CONST_LOOPS, but you are introducing
! oops there.

Was his comment incorrect?

Cheers,
FJP

[1] http://lkml.org/lkml/2009/5/24/159

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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 16:12       ` Frans Pop
@ 2009-06-17 16:23         ` Ingo Molnar
  2009-06-17 16:55           ` Subrata Modak
  2009-06-18  7:27           ` Balbir Singh
  0 siblings, 2 replies; 10+ messages in thread
From: Ingo Molnar @ 2009-06-17 16:23 UTC (permalink / raw)
  To: Frans Pop
  Cc: Subrata Modak, Figo.zhang, lkml, Sumit Panchasara,
	'Sachin P Sant', 'H. Peter Anvin',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh',
	Jaswinder Singh Rajput


* Frans Pop <elendil@planet.nl> wrote:

> On Wednesday 17 June 2009, Ingo Molnar wrote:
> > Ah, and you fixed in what a superior way: you improved the code in
> > the process :-) This is how warnings should be fixed really.
> 
> Hmm. Did you also see Pavel's reply to that patch [1]:
> ! But that's a bug to be fixed, I'd say? ... actually I believe you are
> ! introducing a bug here. Yes, old code would put random numbers in
> ! loops_per_jiffy_ref for !CPUFREQ_CONST_LOOPS, but you are introducing
> ! oops there.
> 
> Was his comment incorrect?
> 
> Cheers,
> FJP
> 
> [1] http://lkml.org/lkml/2009/5/24/159

hm, Pavel seems right - i missed that. Subrata, mind sending an 
updated patch?

Thanks,

	Ingo

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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 16:23         ` Ingo Molnar
@ 2009-06-17 16:55           ` Subrata Modak
  2009-06-18  7:27           ` Balbir Singh
  1 sibling, 0 replies; 10+ messages in thread
From: Subrata Modak @ 2009-06-17 16:55 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frans Pop, Figo.zhang, lkml, Sumit Panchasara,
	'Sachin P Sant', 'H. Peter Anvin',
	'Andi Kleen', 'Thomas Gleixner',
	'Balbir Singh',
	Jaswinder Singh Rajput

On Wed, 2009-06-17 at 18:23 +0200, Ingo Molnar wrote:
> * Frans Pop <elendil@planet.nl> wrote:
> 
> > On Wednesday 17 June 2009, Ingo Molnar wrote:
> > > Ah, and you fixed in what a superior way: you improved the code in
> > > the process :-) This is how warnings should be fixed really.
> > 
> > Hmm. Did you also see Pavel's reply to that patch [1]:
> > ! But that's a bug to be fixed, I'd say? ... actually I believe you are
> > ! introducing a bug here. Yes, old code would put random numbers in
> > ! loops_per_jiffy_ref for !CPUFREQ_CONST_LOOPS, but you are introducing
> > ! oops there.
> > 
> > Was his comment incorrect?
> > 
> > Cheers,
> > FJP
> > 
> > [1] http://lkml.org/lkml/2009/5/24/159
> 
> hm, Pavel seems right - i missed that. Subrata, mind sending an 
> updated patch?

Hmmm. I would try doing that soon.

Regards--
Subrata

> 
> Thanks,
> 
> 	Ingo


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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-17 16:23         ` Ingo Molnar
  2009-06-17 16:55           ` Subrata Modak
@ 2009-06-18  7:27           ` Balbir Singh
  2009-06-18  8:48             ` Subrata Modak
  1 sibling, 1 reply; 10+ messages in thread
From: Balbir Singh @ 2009-06-18  7:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frans Pop, Subrata Modak, Figo.zhang, lkml, Sumit Panchasara,
	'Sachin P Sant', 'H. Peter Anvin',
	'Andi Kleen', 'Thomas Gleixner',
	Jaswinder Singh Rajput

* Ingo Molnar <mingo@elte.hu> [2009-06-17 18:23:03]:

> 
> * Frans Pop <elendil@planet.nl> wrote:
> 
> > On Wednesday 17 June 2009, Ingo Molnar wrote:
> > > Ah, and you fixed in what a superior way: you improved the code in
> > > the process :-) This is how warnings should be fixed really.
> > 
> > Hmm. Did you also see Pavel's reply to that patch [1]:
> > ! But that's a bug to be fixed, I'd say? ... actually I believe you are
> > ! introducing a bug here. Yes, old code would put random numbers in
> > ! loops_per_jiffy_ref for !CPUFREQ_CONST_LOOPS, but you are introducing
> > ! oops there.
> > 
> > Was his comment incorrect?
> > 
> > Cheers,
> > FJP
> > 
> > [1] http://lkml.org/lkml/2009/5/24/159
> 
> hm, Pavel seems right - i missed that. Subrata, mind sending an 
> updated patch?
>

Hi, Ingo,

Yes, it does seem that we'll oops at *lpj, but to be honest the code
is badly written, ideally the CONFIG_SMP part should be abstracted
out, having that in a if loop makes reading it time consuming and
kills a few neuro cells each time.
 

-- 
	Balbir

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

* Re: [PATCH]x86-tsc.c : fix compile warning
  2009-06-18  7:27           ` Balbir Singh
@ 2009-06-18  8:48             ` Subrata Modak
  0 siblings, 0 replies; 10+ messages in thread
From: Subrata Modak @ 2009-06-18  8:48 UTC (permalink / raw)
  To: balbir, Ingo Molnar
  Cc: Frans Pop, Figo.zhang, lkml, Sumit Panchasara,
	'Sachin P Sant', 'H. Peter Anvin',
	'Andi Kleen', 'Thomas Gleixner',
	Jaswinder Singh Rajput

On Thu, 2009-06-18 at 12:57 +0530, Balbir Singh wrote:
> * Ingo Molnar <mingo@elte.hu> [2009-06-17 18:23:03]:
> 
> > 
> > * Frans Pop <elendil@planet.nl> wrote:
> > 
> > > On Wednesday 17 June 2009, Ingo Molnar wrote:
> > > > Ah, and you fixed in what a superior way: you improved the code in
> > > > the process :-) This is how warnings should be fixed really.
> > > 
> > > Hmm. Did you also see Pavel's reply to that patch [1]:
> > > ! But that's a bug to be fixed, I'd say? ... actually I believe you are
> > > ! introducing a bug here. Yes, old code would put random numbers in
> > > ! loops_per_jiffy_ref for !CPUFREQ_CONST_LOOPS, but you are introducing
> > > ! oops there.
> > > 
> > > Was his comment incorrect?
> > > 
> > > Cheers,
> > > FJP
> > > 
> > > [1] http://lkml.org/lkml/2009/5/24/159
> > 
> > hm, Pavel seems right - i missed that. Subrata, mind sending an 
> > updated patch?
> >
> 
> Hi, Ingo,
> 
> Yes, it does seem that we'll oops at *lpj, but to be honest the code
> is badly written, ideally the CONFIG_SMP part should be abstracted
> out, having that in a if loop makes reading it time consuming and
> kills a few neuro cells each time.

Balbir/Ingo,

I find this fixed in todayś Linus´s git tree. dummy has been removed,
and, so does lpj initialization taking place properly.

631 static int time_cpufreq_notifier(struct notifier_block *nb, unsigned
long val,
632                                 void *data)
633 {
634         struct cpufreq_freqs *freq = data;
635         unsigned long *lpj;
636 
637         if (cpu_has(&cpu_data(freq->cpu), X86_FEATURE_CONSTANT_TSC))
638                 return 0;
639 
640         lpj = &boot_cpu_data.loops_per_jiffy;

this gets initialized here for the first time on any system.

641 #ifdef CONFIG_SMP
642         if (!(freq->flags & CPUFREQ_CONST_LOOPS))
643                 lpj = &cpu_data(freq->cpu).loops_per_jiffy;
644 #endif

And gets re-assigned if CONFIG_SMP.

Regards--
Subrata

> 
> 


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

end of thread, other threads:[~2009-06-18  8:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 13:57 [PATCH]x86-tsc.c : fix compile warning Figo.zhang
     [not found] ` <bb33bcf20906170700i4a4ea802yf1da08e9870d6221@mail.gmail.com>
2009-06-17 14:17   ` Subrata Modak
2009-06-17 14:20     ` Figo.zhang
2009-06-17 15:28     ` Ingo Molnar
2009-06-17 16:11       ` Subrata Modak
2009-06-17 16:12       ` Frans Pop
2009-06-17 16:23         ` Ingo Molnar
2009-06-17 16:55           ` Subrata Modak
2009-06-18  7:27           ` Balbir Singh
2009-06-18  8:48             ` Subrata Modak

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.