From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f195.google.com ([209.85.222.195]:38598 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQICM (ORCPT ); Wed, 17 Oct 2018 04:02:12 -0400 Date: Tue, 16 Oct 2018 21:09:12 -0300 From: Leonardo =?utf-8?B?QnLDoXM=?= Subject: [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing. Message-ID: <20181017000912.GA21339@WindFlash> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: lkcamp@lists.libreplanetbr.org Cc: Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org 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 --- 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