Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp149141imm; Tue, 16 Oct 2018 20:07:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV62A/+8lhAIq9Gd/n9rd9R+9GkZiH4xy/qdfbncuXyul+znGsYUZjS3iIlQSgxqVblvgffqB X-Received: by 2002:a63:2356:: with SMTP id u22-v6mr22601176pgm.122.1539745670953; Tue, 16 Oct 2018 20:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539745670; cv=none; d=google.com; s=arc-20160816; b=DPr7D+br/q8zXG4L1SGQhl/Kq5zX/QBFCUpS/A9lWYyfcmDI71o15B84lzocTnxexJ tySva6x1UheGDKaBUEg0Vc8RqP751iVhndBWPVLj0vV33JLT+/fkV3xfHMbIOICF37CT EHPEzANJ478oaK+nvFi2Z6FGsBrQ+wflMAptXm87DZeVLvIvA55O20FkxqBBpNkoUf3B Ili77O3dd3JSOGqibBUJ7I0vi9sF+38is34rJBi9/Rfh3O89NG0UmkOGIHu5pTgVliqf 1G+yWgK9Zxdl9qGmuibsKF47wMpsdL61L8ojFP9qYao7imOpCt+PJVRSyt/Xt27/F3CG tpgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BgxKisD61BhLs1UtCYpfnP656KRko+9InKSH6vZ0d10=; b=EBwnG/8ZOsNQ3CDay68ZQu+1gxv2vcpMVXVaky3mSfMjLZpQNaPpVU9sZMkPihawQx i8qIw3TU7eXNA9hGansAvM8qtLXEqPbAq1EB152BEBijZjeDaHNU8eFVU80YR6SlVesz 4xauB3mIuhcJeFjWJ5PSoJmaeqITBhgmz0iHYDN4WAKV12pQtPXyqVTwgyAz8WACFfUO wLotd/TGwHKnoWL7yB25GPGZ6/iAlh+178hbq56y2jWGluvjdn22sUyOYrwSUWXJXb7p SODg452yFg997C0o0iDRnwnXUt7C5lJiAhvWTw0gA2civSL3hFjtVGMcq56htR/2mD5Z OEwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si16000564pgw.184.2018.10.16.20.07.33; Tue, 16 Oct 2018 20:07:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727315AbeJQLA0 (ORCPT + 99 others); Wed, 17 Oct 2018 07:00:26 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:44270 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbeJQLA0 (ORCPT ); Wed, 17 Oct 2018 07:00:26 -0400 Received: by mail-qk1-f196.google.com with SMTP id y8-v6so15586273qka.11; Tue, 16 Oct 2018 20:06:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BgxKisD61BhLs1UtCYpfnP656KRko+9InKSH6vZ0d10=; b=R+DpnyVyuH1p4SixqPnjUeipIcjdHujGA9ezZQgOIG8rHh9lmFJ3Vfo4SNjHo5Pf1F ookRBLngcA9mDcObTfImpOybRv3zZ0d0m1DXzBGeWOZX3vGAtl/bPGkyCpKUzu+8sAFe HDi7r426gYyzmMwd/EuHy4AhBHC7YouHJz6AJE9DtYcEmr34Etjhzpkx0zd3f8DLigyI 71GfXk9jmJDt9fylNpqbkHJAhbJughzXsrminVPMLgnZsP3GnGBAQfMJ6EpzQgBvQgo/ UUJM2YmcuJHmjSokz6x1qE/rNBKsybnSSstkjNtFFltQq79UKr79hy/Ksv91C0AoXNXV u5nA== X-Gm-Message-State: ABuFfoicf5XSevvQQukI2G6yAFvUjzpcBml2VdG2rHZJEYgXGjJNKuwV e1y8fIQO091mzU/uRZrvQcc= X-Received: by 2002:ae9:c303:: with SMTP id n3-v6mr22886648qkg.163.1539745615801; Tue, 16 Oct 2018 20:06:55 -0700 (PDT) Received: from ?IPv6:2804:431:9718:6346:661:e081:23ef:66b? ([2804:431:9718:6346:661:e081:23ef:66b]) by smtp.gmail.com with ESMTPSA id g39-v6sm11294300qtc.89.2018.10.16.20.06.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 20:06:54 -0700 (PDT) Subject: Re: [Lkcamp] [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing. To: =?UTF-8?Q?Leonardo_Br=c3=a1s?= , lkcamp@lists.libreplanetbr.org Cc: x86@kernel.org, linux-kbuild@vger.kernel.org, Matthew Wilcox , linux-kernel@vger.kernel.org, Masahiro Yamada , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Michal Marek , Thomas Gleixner References: <20181017000912.GA21339@WindFlash> From: Helen Koike Message-ID: Date: Wed, 17 Oct 2018 00:06:49 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181017000912.GA21339@WindFlash> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leonardo, On 10/16/18 9:09 PM, Leonardo Brás wrote: > Removes an unnecessary shadowed local variable (start). > Optimize test of isdigit: > - If isalpha returns true, isdigit will return false, so no need to test. This patch does two different things, it should be in two separated patches. > > 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 */ Actually you can't do that, p is being altered in the first if statement. > > - /* Handle numbers */ > - if (isdigit(*p)) { > /* Find the end of the number */ > q = p + 1; > while (q < nl && (isdigit(*q))) > Regards Helen