Skip to content

Commit 96251a7

Browse files
masahir0ytorvalds
authored andcommitted
lib/cmdline: remove an unneeded local variable in next_arg()
The local variable 'next' is unneeded because you can simply advance the existing pointer 'args'. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6442798 commit 96251a7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/cmdline.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ char *next_arg(char *args, char **param, char **val)
228228
{
229229
unsigned int i, equals = 0;
230230
int in_quote = 0, quoted = 0;
231-
char *next;
232231

233232
if (*args == '"') {
234233
args++;
@@ -266,10 +265,10 @@ char *next_arg(char *args, char **param, char **val)
266265

267266
if (args[i]) {
268267
args[i] = '\0';
269-
next = args + i + 1;
268+
args += i + 1;
270269
} else
271-
next = args + i;
270+
args += i;
272271

273272
/* Chew up trailing spaces. */
274-
return skip_spaces(next);
273+
return skip_spaces(args);
275274
}

0 commit comments

Comments
 (0)