diff mbox

[5/9] md/dm-table: Move an assignment for the variable "end" in dm_split_args()

Message ID e3522c84-b4df-2278-aece-dce7ac8350d1@users.sourceforge.net (mailing list archive)
State Deferred, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

SF Markus Elfring Oct. 1, 2016, 7:47 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 1 Oct 2016 07:51:55 +0200

Move the assignment for the local variable "end" behind the source code
for the initial two condition checks by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-table.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e74763c..0f60417 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -538,7 +538,7 @@  static char **realloc_argv(unsigned *array_size, char **old_argv)
  */
 int dm_split_args(int *argc, char ***argvp, char *input)
 {
-	char *start, *end = input, *out, **argv;
+	char *start, *end, *out, **argv;
 	unsigned array_size = 0;
 
 	*argc = 0;
@@ -552,6 +552,7 @@  int dm_split_args(int *argc, char ***argvp, char *input)
 	if (!argv)
 		return -ENOMEM;
 
+	end = input;
 	while (1) {
 		/* Skip whitespace */
 		start = skip_spaces(end);