lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 19 Jan 2010 14:09:14 -0700
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] drivers/misc/iwmc3200top/log.c: use skip_spaces to strip leading whitespace

Use the library function instead of a while loop.

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>

---

diff --git a/drivers/misc/iwmc3200top/log.c b/drivers/misc/iwmc3200top/log.c
index d569279..fe6dbc0 100644
--- a/drivers/misc/iwmc3200top/log.c
+++ b/drivers/misc/iwmc3200top/log.c
@@ -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",
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ