linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing.
@ 2018-10-17  0:09 Leonardo Brás
  2018-10-17  3:06 ` [Lkcamp] " Helen Koike
  0 siblings, 1 reply; 4+ messages in thread
From: Leonardo Brás @ 2018-10-17  0:09 UTC (permalink / raw)
  To: lkcamp
  Cc: Matthew Wilcox, Andy Lutomirski, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, x86, Masahiro Yamada,
	Michal Marek, linux-kernel, linux-kbuild

    Removes an unnecessary shadowed local variable (start).
    Optimize test of isdigit:
    - If isalpha returns true, isdigit will return false, so no need to test.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
---
 scripts/asn1_compiler.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
index c146020fc783..08bb6e5fd6ad 100644
--- a/scripts/asn1_compiler.c
+++ b/scripts/asn1_compiler.c
@@ -413,7 +413,7 @@ static void tokenise(char *buffer, char *end)
 
 			/* Handle string tokens */
 			if (isalpha(*p)) {
-				const char **dir, *start = p;
+				const char **dir;
 
 				/* Can be a directive, type name or element
 				 * name.  Find the end of the name.
@@ -454,10 +454,9 @@ static void tokenise(char *buffer, char *end)
 
 				tokens[tix++].token_type = TOKEN_TYPE_NAME;
 				continue;
-			}
+			} else if (isdigit(*p)) {
+				/* Handle numbers */
 
-			/* Handle numbers */
-			if (isdigit(*p)) {
 				/* Find the end of the number */
 				q = p + 1;
 				while (q < nl && (isdigit(*q)))
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-19  2:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17  0:09 [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing Leonardo Brás
2018-10-17  3:06 ` [Lkcamp] " Helen Koike
2018-10-18  2:03   ` Leonardo Bras
2018-10-19  2:44     ` Masahiro Yamada

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).