From: John Kacur <jkacur@redhat.com>
To: hpa@zytor.com, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-rt-users@vger.kernel.org,
Clark Williams <williams@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Sven-Thorsten Dietrich <sven@thebigcorporation.com>
Subject: Simplify the code in cpuid_open
Date: Thu, 8 Oct 2009 17:20:15 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0910081706250.24270@localhost.localdomain> (raw)
Peter picked up my patch for tip/x86/cpu that removes the bkl in
cpuid_open. Ingo subsequently merged that into tip/master.
The following patch folds back-in tglx's patch that we should have known
about if we had looked into tip/rt/bkl in the first place!
Please pick it up for tip/x86/cpu and tip/master.
>From b416b75555aca5e7f066f6edd824fce4b7d08d28 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 8 Oct 2009 16:31:57 +0200
Subject: [PATCH] Simplify the code in cpuid_open
This patch folds back in tglx's 55968ede164ae523692f00717f50cd926f1382a0
to my patch that removed the bkl.
This simplifies the code, and makes it consistent with the changes to
kill the bkl in msr.c as well.
This is applied against tip/master
Signed-off-by: John Kacur <jkacur@redhat.com>
---
arch/x86/kernel/cpuid.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 8bb8401..7ef24a7 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -116,18 +116,16 @@ static int cpuid_open(struct inode *inode, struct file *file)
{
unsigned int cpu;
struct cpuinfo_x86 *c;
- int ret = 0;
cpu = iminor(file->f_path.dentry->d_inode);
- if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
- ret = -ENXIO; /* No such CPU */
- goto out;
- }
+ if (cpu >= nr_cpu_ids || !cpu_online(cpu))
+ return -ENXIO; /* No such CPU */
+
c = &cpu_data(cpu);
if (c->cpuid_level < 0)
- ret = -EIO; /* CPUID not supported */
-out:
- return ret;
+ return -EIO; /* CPUID not supported */
+
+ return 0;
}
/*
--
1.6.0.6
reply other threads:[~2009-10-08 15:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=alpine.LFD.2.00.0910081706250.24270@localhost.localdomain \
--to=jkacur@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sven@thebigcorporation.com \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/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®