lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181017000912.GA21339@WindFlash>
Date:   Tue, 16 Oct 2018 21:09:12 -0300
From:   Leonardo Brás <leobras.c@...il.com>
To:     lkcamp@...ts.libreplanetbr.org
Cc:     Matthew Wilcox <willy6545@...il.com>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org
Subject: [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and
 optimize testing.

    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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ