public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mark Langsdorf <mark.langsdorf@amd.com>,
	Andreas Herrmann <andreas.herrmann3@amd.com>
Subject: [PATCH -tip] x86: cpu/intel_cacheinfo.c fix compilation warnings
Date: Tue, 14 Apr 2009 18:13:10 +0530	[thread overview]
Message-ID: <1239712990.3079.17.camel@ht.satnam> (raw)

fix:
  arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘show_cache_disable’:
  arch/x86/kernel/cpu/intel_cacheinfo.c:712: warning: unused variable ‘node’
  arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘store_cache_disable’:
  arch/x86/kernel/cpu/intel_cacheinfo.c:739: warning: unused variable ‘node’

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/cpu/intel_cacheinfo.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 789efe2..6794d3e 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -708,14 +708,15 @@ static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf)
 static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf,
 				  unsigned int index)
 {
-	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
-	int node = cpu_to_node(cpu);
-	struct pci_dev *dev = node_to_k8_nb_misc(node);
+	struct pci_dev *dev;
 	unsigned int reg = 0;
+	int cpu;
 
 	if (!this_leaf->can_disable)
 		return -EINVAL;
 
+	cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
+	dev = node_to_k8_nb_misc(cpu_to_node(cpu));
 	if (!dev)
 		return -EINVAL;
 
@@ -735,11 +736,10 @@ SHOW_CACHE_DISABLE(1)
 static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
 	const char *buf, size_t count, unsigned int index)
 {
-	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
-	int node = cpu_to_node(cpu);
-	struct pci_dev *dev = node_to_k8_nb_misc(node);
-	unsigned long val = 0;
+	struct pci_dev *dev;
 	unsigned int scrubber = 0;
+	unsigned long val = 0;
+	int cpu;
 
 	if (!this_leaf->can_disable)
 		return -EINVAL;
@@ -747,6 +747,8 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
+	cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
+	dev = node_to_k8_nb_misc(cpu_to_node(cpu));
 	if (!dev)
 		return -EINVAL;
 
-- 
1.6.0.6




             reply	other threads:[~2009-04-14 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 12:43 Jaswinder Singh Rajput [this message]
2009-04-14 13:32 ` [PATCH -tip] x86: cpu/intel_cacheinfo.c fix compilation warnings Ingo Molnar
2009-04-14 16:46   ` Jaswinder Singh Rajput
2009-04-14 16:54     ` Ingo Molnar

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=1239712990.3079.17.camel@ht.satnam \
    --to=jaswinder@kernel.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@amd.com \
    --cc=mingo@elte.hu \
    --cc=x86@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