Skip to contentSkip to conversation

sysctl_binary.c: use skip_spaces to strip leading whitespace

PATCH New H Hartley Sweeten 1 participant 1 message Jan 19, 2010 Proc sysctl

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysctl_binary.c: use skip_spaces to strip leading whitespace

Use the library function instead of a while loop.

---

kernel/sysctl_binary.c +2 -4
index 8f5d16e..0220e35 100644
@@ -1001,8 +1001,7 @@ static ssize_t bin_intvec(struct file *file,
 			unsigned long value;
 
 			value = simple_strtoul(str, &str, 10);
-			while (isspace(*str))
-				str++;
+			str = skip_spaces(str);
 			
 			result = -EFAULT;
 			if (put_user(value, vec + i))
@@ -1079,8 +1078,7 @@ static ssize_t bin_ulongvec(struct file *file,
 			unsigned long value;
 
 			value = simple_strtoul(str, &str, 10);
-			while (isspace(*str))
-				str++;
+			str = skip_spaces(str);
 			
 			result = -EFAULT;
 			if (put_user(value, vec + i))