From patchwork Thu Jul 11 07:33:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11039405 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 C9A22912 for ; Thu, 11 Jul 2019 07:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7B5D28A52 for ; Thu, 11 Jul 2019 07:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98B4828A54; Thu, 11 Jul 2019 07:33:46 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 6A9BC28A52 for ; Thu, 11 Jul 2019 07:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfGKHdp (ORCPT ); Thu, 11 Jul 2019 03:33:45 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:19441 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfGKHdp (ORCPT ); Thu, 11 Jul 2019 03:33:45 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x6B7XLLw018488; Thu, 11 Jul 2019 16:33:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x6B7XLLw018488 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562830401; bh=MZwpBJbLH3Ic2lOMoV20H/PdiklfdpBShYF4i0kx/jY=; h=From:To:Cc:Subject:Date:From; b=TxPpOXLvSm8MuBuO12dsz6WyNZhNuRu1ZNCwJvVMLbytDWVRfMccvOILi+80lmCO2 u+cxOu/nnDO8iscotHKgqOuNgwmPargDzjCorEZ9g3d1A0TzmaiP7QpkHx6eQgxHSO teqYoGKcxZHNOUSPlWTSVqjQ8vduuaszTDUZasdcDPfUfGui74yhbOMMCsrB67Rle0 HTc3A6HaGpGjIAowXaef9BiWrSPbYTlENLmoeYnbiWfInHouC9AgweRgEGMeCYdkqc sqshB1FtKtZ2yu9pKnr5Xv462ed4U9nAjw9mWM34LrKTNwwV5/r/ZUgi5+heuGROiu Hzn4FSEjbWeYQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] kconfig: remove meaningless if-conditional in conf_read() Date: Thu, 11 Jul 2019 16:33:17 +0900 Message-Id: <20190711073317.27248-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 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 sym_is_choice(sym) has already been checked by previous if-block: if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) continue; Hence, the following code is redundant, and the comment is misleading: if (!sym_is_choice(sym)) continue; /* fall through */ It always takes 'continue', never falls though. Clean up the dead code. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 18e8051d89d7..cbb6efa4a5a6 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -534,11 +534,9 @@ int conf_read(const char *name) switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: - if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) - break; - if (!sym_is_choice(sym)) + if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) continue; - /* fall through */ + break; default: if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) continue;