From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbdLFUYq (ORCPT ); Wed, 6 Dec 2017 15:24:46 -0500 Received: from merlin.infradead.org ([205.233.59.134]:60600 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdLFUYo (ORCPT ); Wed, 6 Dec 2017 15:24:44 -0500 Subject: Re: [PATCH] kconfig: fix relational operators for bool and tristate symbols To: Nicolas Pitre , Masahiro Yamada , Michal Marek , Jan Beulich Cc: Arnd Bergmann , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Randy Dunlap Message-ID: Date: Wed, 6 Dec 2017 12:24:36 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/06/2017 07:40 AM, Nicolas Pitre wrote: > > Ping. > > On Thu, 16 Nov 2017, Nicolas Pitre wrote: > >> 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 Acked-by: Randy Dunlap Tested-by: Randy Dunlap -- ~Randy