Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6072920imm; Wed, 12 Sep 2018 16:09:44 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaww0G3pQY/eduLUn8sLZhyAF5JzNHTLf9wBDCwydLfGB4hUYzwxeL6sI/TbUvBPmw/c7V8 X-Received: by 2002:a63:ed4f:: with SMTP id m15-v6mr1832837pgk.147.1536793783950; Wed, 12 Sep 2018 16:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536793783; cv=none; d=google.com; s=arc-20160816; b=gbTE/3EVwtlHy7/8QYGZu0C2XhsmE6cWl/km383Dr9mzHpWBWG9FDlOV+cNUzU9m3v uEGqGo3o5KD9UQEtpBLU/zRKaO5EGOoL659BQqIz7NNwIxDo/k7Sv5ZWQcQhCxhtBs6K 2ukQblYVPsX3+3EAQ/zR/++1WchLNubzDsKYUcmgiNxqAVgNJF4NRutIuMvJ1vhOU3KF Lp6upgR2CP9q+SCeMezArSqC7yZtVE1D0wAet11wQ+IJtqNGpY4+j3EPCEc8Bxu3jVzK RhWSoE7BT8Gkx6Gpr2KjIC9Hh72+LiJUf24YjQqvh8N6eB+qY3Z9E2aAYLqMLdAv7dIC vULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:to:from:date :dkim-signature; bh=PMBhSsUTwZQfsvYWSUIflvFWLLu4tkrVGV+SyhSri1Y=; b=hEEhu+388YkSQx74uTUsKXdEM6O1Iqz83abaNSQpXWB0h8BA8g/f1vQRDVXujW6+j7 yxAsVQRwfhpmhhkwKsUzP2v50x4zjujItg4vLlj+uSakhL/Tdxkm0LyBdRvIn49gKexm zzV+7JlOj5IRum5SVxAdvdqJ6e/L25/0D/QDjBvgbElwI0cYLuWUXGyMKqIkDf1ll3Vb gbd/iIplf4jmFOc4J8Kleaciq83B7h18Brm+vHKhfqEAuMMT5akDEMa1ipfZnvIS8o2T Ratq4NVRXUBQ9XcJ9XBlwtUiksifoLDi/N6455RCJ0u22O87CSjb/FjmUe0he1pvJyOV 0uAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K8EYQUV6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34-v6si2329251pld.149.2018.09.12.16.09.27; Wed, 12 Sep 2018 16:09:43 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K8EYQUV6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbeIMEPu (ORCPT + 99 others); Thu, 13 Sep 2018 00:15:50 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44094 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725751AbeIMEPu (ORCPT ); Thu, 13 Sep 2018 00:15:50 -0400 Received: by mail-qk1-f193.google.com with SMTP id d131-v6so2178419qke.11 for ; Wed, 12 Sep 2018 16:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=PMBhSsUTwZQfsvYWSUIflvFWLLu4tkrVGV+SyhSri1Y=; b=K8EYQUV6Y4+Mr42NG7nL2JIlVboS6BsvhVX6I9qovcI5n95zUw3jcbGnc8Zz7Exhgg cmfjUgDWkUuc01mxnfMRIAKLRU1OTzLMltgh2quQC/RPa8yjxzDFJGpPQbnfd7GaiSjU vvwYPW+PT00pLh6KGgtz4mRwtkLDi0V5uLwuSnmYEXC7kJIz34YRDCseYzwi/wfBGexj 0zkfBcGy3CbpIWvl6NLanynodq4N4UIpvS+H1/NEU3zSAqnECKpxNmswdAsLWwBUtsaB lVMp/98KBHWBT1KFmfRjlAnSNrUOPkWcdrpfB41n4Ij9m4QswX/uRnrFojPEMlqZUxqc jpgQ== 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:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=PMBhSsUTwZQfsvYWSUIflvFWLLu4tkrVGV+SyhSri1Y=; b=NZxCDOBLYugYEY3iPkygFuCRM8jeh4QVmocpd9cR/fE4n15u9244oMJPiIxGpd4URT T1wGndbVZpBiHW7Y7btO5RFj8ikhvnZD4zLVLEKnMbrnKFRkUHiN/cuJoxluaVLSFWdF WbFDO7ES2uKjWjJGFqgzAS77JMuyPAt0GKcBZsiuTrfftHadwUaLXrGLXzYjdFzMnbOS 9oY3BkXLdfJPV62G0QbdFcwfNCseeY6F6dtSYhcF83mwk33MNVZhhtJJusDCk5s59+d7 HUquTxj7tRimFfZWkK8EdMaIS3020YdV4ELUJgX4+D9U/0VyNKNE9rKiROX2iHA9EIyC YqKw== X-Gm-Message-State: APzg51CUs9pUG5SDt6a2NIgjJlMmg8PqSMjxA5Ir2KF5DUsBnwYSndpg 2BnXhgJ3JXrkSy57+lv1mOww5Qju X-Received: by 2002:a37:c392:: with SMTP id r18-v6mr3290762qkl.56.1536793747455; Wed, 12 Sep 2018 16:09:07 -0700 (PDT) Received: from WindFlash ([201.82.148.26]) by smtp.gmail.com with ESMTPSA id y47-v6sm1596191qtk.27.2018.09.12.16.09.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 16:09:06 -0700 (PDT) Date: Wed, 12 Sep 2018 20:09:02 -0300 From: Leonardo =?utf-8?B?QnLDoXM=?= To: linux-kernel@vger.kernel.org Subject: [PATCH] Optimize tests and remove shadowed local variable. Message-ID: <20180912230902.GA9625@WindFlash> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index c146020fc783..a0056df4e358 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,10 @@ static void tokenise(char *buffer, char *end) tokens[tix++].token_type = TOKEN_TYPE_NAME; continue; - } - /* Handle numbers */ - if (isdigit(*p)) { + } else if (isdigit(*p)) { + /* Handle numbers */ + /* Find the end of the number */ q = p + 1; while (q < nl && (isdigit(*q))) -- 2.19.0