From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] drivers/misc/iwmc3200top/log.c: use skip_spaces to strip leading whitespace
Date: Tue, 19 Jan 2010 14:09:14 -0700 [thread overview]
Message-ID: <201001191409.14705.hartleys@visionengravers.com> (raw)
Use the library function instead of a while loop.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.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",
reply other threads:[~2010-01-19 21:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201001191409.14705.hartleys@visionengravers.com \
--to=hartleys@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®