mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Brian Gerst <bgerst@didntduck.org>
Cc: davej@codemonkey.org.uk, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix warning in powernow-k8.c
Date: Fri, 3 Jun 2005 18:11:32 +0200	[thread overview]
Message-ID: <20050603161132.GB5083@elf.ucw.cz> (raw)
In-Reply-To: <429F3A9E.504@didntduck.org>

Hi!

> Fix this warning:
> powernow-k8.c: In function ?query_current_values_with_pending_wait?:
> powernow-k8.c:110: warning: ?hi? may be used uninitialized in this
> function

Are you sure?

Original code is clearly buggy; I do not think you need that ugly do
{} while loop.

								Pavel
> 
> Signed-off-by: Brian Gerst <bgerst@didntduck.org>

> diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
> --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
> +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
> @@ -110,14 +110,13 @@ static int query_current_values_with_pen
>  	u32 lo, hi;
>  	u32 i = 0;
>  
> -	lo = MSR_S_LO_CHANGE_PENDING;
> -	while (lo & MSR_S_LO_CHANGE_PENDING) {
> +	do {
>  		if (i++ > 0x1000000) {
>  			printk(KERN_ERR PFX "detected change pending stuck\n");
>  			return 1;
>  		}
>  		rdmsr(MSR_FIDVID_STATUS, lo, hi);
> -	}
> +	} while (lo & MSR_S_LO_CHANGE_PENDING);
>  
>  	data->currvid = hi & MSR_S_HI_CURRENT_VID;
>  	data->currfid = lo & MSR_S_LO_CURRENT_FID;


-- 

  reply	other threads:[~2005-06-03 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02 16:58 Brian Gerst
2005-06-03 16:11 ` Pavel Machek [this message]
2005-06-03 18:31   ` Brian Gerst
2005-06-03 18:56     ` Pavel Machek

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=20050603161132.GB5083@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=bgerst@didntduck.org \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®