Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755690Ab0ASVJN (ORCPT ); Tue, 19 Jan 2010 16:09:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755660Ab0ASVJL (ORCPT ); Tue, 19 Jan 2010 16:09:11 -0500 Received: from [206.15.93.42] ([206.15.93.42]:13367 "EHLO visionfs1.visionengravers.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755631Ab0ASVJJ (ORCPT ); Tue, 19 Jan 2010 16:09:09 -0500 From: H Hartley Sweeten To: Linux Kernel Subject: [PATCH] drivers/misc/iwmc3200top/log.c: use skip_spaces to strip leading whitespace Date: Tue, 19 Jan 2010 14:09:14 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201001191409.14705.hartleys@visionengravers.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 45 Use the library function instead of a while loop. Signed-off-by: H Hartley Sweeten --- 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 #include -#include +#include #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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/