Skip to contentSkip to conversation

drivers/misc/iwmc3200top/log.c: use skip_spaces to strip leading whitespace

PATCH New H Hartley Sweeten 1 participant 1 message Jan 19, 2010 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/misc/iwmc3200top/log.c: use skip_spaces to strip leading whitespace

Use the library function instead of a while loop.

---

drivers/misc/iwmc3200top/log.c +3 -6
index d569279..fe6dbc0 100644
@@ -26,7 +26,7 @@
 
 #include <linux/kernel.h>
 #include <linux/mmc/sdio_func.h>
-#include <linux/ctype.h>
+#include <linux/string.h>
 #include "fw-msg.h"
 #include "iwmc3200top.h"
 #include "log.h"
@@ -224,8 +224,7 @@ ssize_t store_iwmct_log_level(struct device *d,
 	memcpy(str_buf, buf, count);
 
 	while ((token = strsep(&str_buf, ",")) != NULL) {
-		while (isspace(*token))
-			++token;
+		token = skip_spaces(token);
 		if (strict_strtol(token, HEXADECIMAL_RADIX, &val)) {
 			LOG_ERROR(priv, DEBUGFS,
 				  "failed to convert string to long %s\n",
@@ -307,9 +306,7 @@ ssize_t store_iwmct_log_level_fw(struct device *d,
 	for (i = 0; ((token = strsep(&str_buf, ",")) != NULL) &&
 		     (i < FW_LOG_SRC_MAX); i++) {
 
-		while (isspace(*token))
-			++token;
-
+		token = skip_spaces(token);
 		if (strict_strtol(token, HEXADECIMAL_RADIX, &val)) {
 			LOG_ERROR(priv, DEBUGFS,
 				  "failed to convert string to long %s\n",