[PATCH 2/2] staging: lustre: Fix trailing statement error in libcfs_string.c
Matthew Tyler
matt.tyler at flashics.com
Wed Dec 10 14:54:35 UTC 2014
This patch fixes a trailing statement warning found by checkpatch.pl
Signed-off-by: Matthew Tyler <matt.tyler at flashics.com>
---
drivers/staging/lustre/lustre/libcfs/libcfs_string.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index e67a18d..1cc4afb 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -48,7 +48,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
{
const char *debugstr;
char op = 0;
- int newmask = minmask, i, len, found = 0;
+ int newmask = minmask, i, len = 0, found = 0;
/* <str> must be a list of tokens separated by whitespace
* and optionally an operator ('+' or '-'). If an operator
@@ -72,8 +72,9 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
}
/* find token length */
- for (len = 0; str[len] != 0 && !isspace(str[len]) &&
- str[len] != '+' && str[len] != '-'; len++);
+ while (str[len] != 0 && !isspace(str[len]) &&
+ str[len] != '+' && str[len] != '-')
+ len++;
/* match token */
found = 0;
--
2.1.3
More information about the devel
mailing list