[PATCH 2/2] staging: lustre: Fix trailing statement error in libcfs_string.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes a trailing statement warning found by checkpatch.pl

Signed-off-by: Matthew Tyler <matt.tyler@xxxxxxxxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux