From patchwork Wed Oct 17 00:09:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10644461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7484B17D4 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6269D2A519 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5641C2A525; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2EB2A519 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbeJQICM (ORCPT ); Wed, 17 Oct 2018 04:02:12 -0400 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 Received: by mail-qk1-f195.google.com with SMTP id 204-v6so15368888qkd.5; Tue, 16 Oct 2018 17:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=Du6wml9VVnou4jAkLBGM3hlzod6FF9zbSLCzf+JCveM=; b=fQwfadr91a5AmyHL08cXCsMHfp0fqJCUcmYZiXoprz3VziZ5qrrfnU5tEQJYzMh+HK /X06MimgPOluZywapGGBft4kszDXVnOfsgbQNNTxLhZ2dQgzoJGcWTJbnwNuCC/x/Vwc eKsIkHXneVtPRYGuQrtcBbaqSXnNDiVoMvsvpDjvukqUEAK0FLmBpFjyPioRX857h4jP 2Lzqf+3SUYN/drc2FJWI86kFFXA3fl/fXOy24COSX5fACIUOVxHXsk0NMTGIdx1rlbn/ fSqWqh8r5xY7ASkR3udc4qN4APAvX2qVF8vSrgojwOFUItzKGJIywZGFAyBSEQgFdmDv 6M2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=Du6wml9VVnou4jAkLBGM3hlzod6FF9zbSLCzf+JCveM=; b=D4GB1H6KszFK92T/8nCdD0L18AUhTo1bidV8RlF4xH5q6QjlX7HJN2DhwQuPZETcno KlmX6DRP8m7zMKWjQNwvNb43PRqu+jDRBr0Ar1KPtS+I4LLt2YQE7YkvSa9yi5fTN7NF vYTGMYzFVnFN8p6OqtDMRWj5nJ+m69CUiJX4GAdwgZBG9omUeV+lpLeFLc4OV/9Uo/Ch EP10+sNUc7TV0nQMcRga2gjyuBUYyF3B4fgX8DT805oCgFEbcQovSOV3yug5VAXktgNy 3JGoPGLT5RUOjdRYe4/d0dZRFmHAZ5V5cO7Yx33RRNiEcWnEXQdYkv56hoY0VAIZmYYr 0G9A== X-Gm-Message-State: ABuFfojADJwStt81tNPCl15XjMwgWwgFKJRUPaWeOTa0lLlvCOsH1UR1 SOrLmxxo00+Ir8gXkPHJOiVYCaRQ X-Google-Smtp-Source: ACcGV60Kx2VZtZjsmf8vexcO8pwt5URdSQ4/2O0lQOTObvxA2XSWV63/+U2AFS2ZLWJCJUJZYdC9lA== X-Received: by 2002:a37:2d46:: with SMTP id t67-v6mr22525808qkh.351.1539734957923; Tue, 16 Oct 2018 17:09:17 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id a72-v6sm8297662qkc.19.2018.10.16.17.09.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:09:17 -0700 (PDT) Date: Tue, 16 Oct 2018 21:09:12 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= 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 Subject: [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing. Message-ID: <20181017000912.GA21339@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)))