* [PATCH] arch/x86/kernel/cpu/mtrr/if.c: Convert for loop to while, avoid naked semicolon
@ 2009-09-14 16:28 Joe Perches
2009-09-20 18:27 ` [tip:x86/urgent] x86, mtrr: Convert loop to a while based construct, " tip-bot for Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2009-09-14 16:28 UTC (permalink / raw)
To: x86; +Cc: H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML
Perhaps this is a more readable/standard form
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index 08b6ea4..f04e725 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -126,8 +126,8 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
return -EINVAL;
base = simple_strtoull(line + 5, &ptr, 0);
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
if (strncmp(ptr, "size=", 5))
return -EINVAL;
@@ -135,14 +135,14 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
size = simple_strtoull(ptr + 5, &ptr, 0);
if ((base & 0xfff) || (size & 0xfff))
return -EINVAL;
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
if (strncmp(ptr, "type=", 5))
return -EINVAL;
ptr += 5;
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
for (i = 0; i < MTRR_NUM_TYPES; ++i) {
if (strcmp(ptr, mtrr_strings[i]))
^ permalink raw reply [flat|nested] 2+ messages in thread* [tip:x86/urgent] x86, mtrr: Convert loop to a while based construct, avoid naked semicolon
2009-09-14 16:28 [PATCH] arch/x86/kernel/cpu/mtrr/if.c: Convert for loop to while, avoid naked semicolon Joe Perches
@ 2009-09-20 18:27 ` tip-bot for Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Joe Perches @ 2009-09-20 18:27 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, joe, tglx, mingo
Commit-ID: 9ff6d8e06fbd9249804d43574167c2acc52886be
Gitweb: http://git.kernel.org/tip/9ff6d8e06fbd9249804d43574167c2acc52886be
Author: Joe Perches <joe@perches.com>
AuthorDate: Mon, 14 Sep 2009 09:28:07 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 20 Sep 2009 20:12:21 +0200
x86, mtrr: Convert loop to a while based construct, avoid naked semicolon
Perhaps this is a more readable/standard form.
Signed-off-by: Joe Perches <joe@perches.com>
LKML-Reference: <1252945687.3937.14.camel@Joe-Laptop.home>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/cpu/mtrr/if.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index 08b6ea4..f04e725 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -126,8 +126,8 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
return -EINVAL;
base = simple_strtoull(line + 5, &ptr, 0);
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
if (strncmp(ptr, "size=", 5))
return -EINVAL;
@@ -135,14 +135,14 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
size = simple_strtoull(ptr + 5, &ptr, 0);
if ((base & 0xfff) || (size & 0xfff))
return -EINVAL;
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
if (strncmp(ptr, "type=", 5))
return -EINVAL;
ptr += 5;
- for (; isspace(*ptr); ++ptr)
- ;
+ while (isspace(*ptr))
+ ptr++;
for (i = 0; i < MTRR_NUM_TYPES; ++i) {
if (strcmp(ptr, mtrr_strings[i]))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-20 18:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-14 16:28 [PATCH] arch/x86/kernel/cpu/mtrr/if.c: Convert for loop to while, avoid naked semicolon Joe Perches
2009-09-20 18:27 ` [tip:x86/urgent] x86, mtrr: Convert loop to a while based construct, " tip-bot for Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome