From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH] lib/cmdline: remove an unneeded local variable in next_arg()
Date: Mon, 1 Feb 2021 10:47:07 +0900 [thread overview]
Message-ID: <20210201014707.3828753-1-masahiroy@kernel.org> (raw)
The local variable 'next' is unneeded because you can simply advance
the existing pointer 'args'.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
lib/cmdline.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/cmdline.c b/lib/cmdline.c
index b390dd03363b..f9844ea417c0 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -215,7 +215,6 @@ char *next_arg(char *args, char **param, char **val)
{
unsigned int i, equals = 0;
int in_quote = 0, quoted = 0;
- char *next;
if (*args == '"') {
args++;
@@ -253,10 +252,10 @@ char *next_arg(char *args, char **param, char **val)
if (args[i]) {
args[i] = '\0';
- next = args + i + 1;
+ args += i + 1;
} else
- next = args + i;
+ args += i;
/* Chew up trailing spaces. */
- return skip_spaces(next);
+ return skip_spaces(args);
}
--
2.27.0
reply other threads:[~2021-02-01 1:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210201014707.3828753-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).