From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbeAERfE (ORCPT + 1 other); Fri, 5 Jan 2018 12:35:04 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:50608 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbeAERfC (ORCPT ); Fri, 5 Jan 2018 12:35:02 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w05HYhxG017429 X-Nifty-SrcIP: [209.85.213.52] X-Google-Smtp-Source: ACJfBotABclga6atuKHJJH2pJaZ3xehvkehEhiYmt5w/uB/V8TlA8cFbZwrkp+9LHE06HnKxVn4dv58cA8hCQLsrDGY= MIME-Version: 1.0 In-Reply-To: References: From: Masahiro Yamada Date: Sat, 6 Jan 2018 02:34:02 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kconfig: fix relational operators for bool and tristate symbols To: Nicolas Pitre Cc: Michal Marek , Jan Beulich , Arnd Bergmann , Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 2017-11-17 10:06 GMT+09:00 Nicolas Pitre : > Since commit 31847b67bec0 ("kconfig: allow use of relations other than > (in)equality") it is possible to use relational operators in Kconfig > statements. However, those operators give unexpected results when > applied to bool/tristate values: > > (n < y) = y (correct) > (m < y) = y (correct) > (n < m) = n (wrong) > > This happens because relational operators process bool and tristate > symbols as strings and m sorts before n. It makes little sense to do a > lexicographical compare on bool and tristate values though. > > Documentation/kbuild/kconfig-language.txt states that expression can have > a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations). > Let's make it so for relational comparisons with bool/tristate > expressions as well and document them. If at least one symbol is an > actual string then the lexicographical compare works just as before. > > Signed-off-by: Nicolas Pitre > Applied to linux-kbuild/fixes. Thanks! -- Best Regards Masahiro Yamada