Skip to contentSkip to conversation

arch/x86/kernel/cpu/mtrr/if.c: Convert for loop to while, avoid naked semicolon

PATCH In review Joe Perches 1 participant 2 messages Sep 14, 2009 – Sep 20, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/kernel/cpu/mtrr/if.c: Convert for loop to while, avoid naked semicolon

Perhaps this is a more readable/standard form

arch/x86/kernel/cpu/mtrr/if.c +6 -6
index 08b6ea4..f04e725 100644
@@ -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]))
#1 lore raw

[tip:x86/urgent] x86, mtrr: Convert loop to a while based construct, avoid naked semicolon

Commit-ID:  9ff6d8e06fbd9249804d43574167c2acc52886be
Gitweb:     http://git.kernel.org/tip/9ff6d8e06fbd9249804d43574167c2acc52886be
Author:     Joe Perches <[email protected]>
AuthorDate: Mon, 14 Sep 2009 09:28:07 -0700
Committer:  Ingo Molnar <[email protected]>
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.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/mtrr/if.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/mtrr/if.c +6 -6
index 08b6ea4..f04e725 100644
@@ -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]))