public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] perf, x86: Improve debug output in check_hw_exists()
Date: Fri, 22 Jun 2012 18:36:43 +0200	[thread overview]
Message-ID: <20120622163643.GK24632@erda.amd.com> (raw)
In-Reply-To: <1340380427.18025.84.camel@twins>

On 22.06.12 17:53:47, Peter Zijlstra wrote:
> My gcc wants me to add the below to avoid used uninitialized warns:
> 
> ---
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -211,8 +211,9 @@ static bool check_hw_exists(void)
>  	 * that don't trap on the MSR access and always return 0s.
>  	 */
>  	val = 0xabcdUL;
> -	ret = wrmsrl_safe(x86_pmu_event_addr(0), val);
> -	ret |= rdmsrl_safe(x86_pmu_event_addr(0), &val_new);
> +	reg = x86_pmu_event_addr(0);
> +	ret = wrmsrl_safe(reg, val);
> +	ret |= rdmsrl_safe(reg, &val_new);

Yes, this is correct. It fixes also correct reporting of reg if it
fails here.

I wonder why my gcc this didn't report, its 4.4.5.

Thanks,

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center


  reply	other threads:[~2012-06-22 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 18:46 [PATCH 0/4] perf, x86: Updates and cleanups Robert Richter
2012-06-20 18:46 ` [PATCH 1/4] perf, x86: Rename Intel specific macros Robert Richter
2012-07-06  6:25   ` [tip:perf/core] perf/x86: " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 2/4] perf, x86: Move Intel specific code to intel_pmu_init() Robert Richter
2012-07-06  6:26   ` [tip:perf/core] perf/x86: " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 3/4] perf, amd: Unify AMD's generic and family 15h pmus Robert Richter
2012-07-06  6:26   ` [tip:perf/core] perf/x86/amd: Unify AMD' s " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 4/4] perf, x86: Improve debug output in check_hw_exists() Robert Richter
2012-06-22 15:53   ` Peter Zijlstra
2012-06-22 16:36     ` Robert Richter [this message]
2012-06-27  9:59       ` Peter Zijlstra
2012-07-06  6:27   ` [tip:perf/core] perf/x86: Improve debug output in check_hw_exists( ) tip-bot for Robert Richter
2012-06-20 20:09 ` [PATCH 0/4] perf, x86: Updates and cleanups Peter Zijlstra

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=20120622163643.GK24632@erda.amd.com \
    --to=robert.richter@amd.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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