From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7678C3A5A0 for ; Mon, 20 Apr 2020 18:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B87992084D for ; Mon, 20 Apr 2020 18:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587408141; bh=J1Pz4saX9jEjbkW/1+ZB7lzOWI+VGAU8j2Mv8AfiHU4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=FhmMJGBL8jidjn+35rNo50b5MLxGceUdyi1Sxo6tvJUtMjlqukxqqOtSRmT62CDHi 9zett9WGPi2Z0ysSOBlXrC/hlJ4CidrH4gk+inzEUdMcAZrQlNSP98VIO5uGGQt2aF xRvGVkQ2PYO3KZMsTrwSgUUULc8SZ+hyn+uWEfa4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727776AbgDTSmV (ORCPT ); Mon, 20 Apr 2020 14:42:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:49518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbgDTSmU (ORCPT ); Mon, 20 Apr 2020 14:42:20 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F4802074F; Mon, 20 Apr 2020 18:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587408140; bh=J1Pz4saX9jEjbkW/1+ZB7lzOWI+VGAU8j2Mv8AfiHU4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JsAB6+t1dHV6pvoNwy2P8v+KHnBGozzcYEBAsOqCqaQK7HENSdA/Epo8cuYKfdaeH UQmrYop56C28Q6adcFqTx4BaxJjZ9m7iZ1VJO4KIbv7oJr7VzX8Xfj1938D62gu5ay CxfzWhjJbvIpNgzF6SClWGl8oh09kyNCstcquWOI= Date: Mon, 20 Apr 2020 11:42:18 -0700 From: Jakub Kicinski To: Jani Nikula Cc: Masahiro Yamada , Nicolas Pitre , Saeed Mahameed , Linux Kbuild mailing list , Arnd Bergmann , Jason Gunthorpe , Neil Armstrong , Laurent Pinchart , Leon Romanovsky , Kieran Bingham , jonas@kwiboo.se, David Airlie , jernej.skrabec@siol.net, Linux Kernel Mailing List , Networking , linux-rdma@vger.kernel.org Subject: Re: [RFC PATCH 1/2] Kconfig: Introduce "uses" keyword Message-ID: <20200420114218.30b373d4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <87v9lu1ra6.fsf@intel.com> References: <20200417011146.83973-1-saeedm@mellanox.com> <87v9lu1ra6.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Apr 2020 11:43:13 +0300 Jani Nikula wrote: > On Sun, 19 Apr 2020, Masahiro Yamada wrote: > > On Sun, Apr 19, 2020 at 4:11 AM Nicolas Pitre wrote: > >> > >> On Sun, 19 Apr 2020, Masahiro Yamada wrote: > >> > >> > (FOO || !FOO) is difficult to understand, but > >> > the behavior of "uses FOO" is as difficult to grasp. > >> > >> Can't this be expressed as the following instead: > >> > >> depends on FOO if FOO > >> > >> That would be a little clearer. > >> > >> > >> Nicolas > > > > 'depends on' does not take the 'if ' > > > > 'depends on A if B' is the syntax sugar of > > 'depends on (A || !B), right ? > > > > I do not know how clearer it would make things. > > > > depends on (m || FOO != m) > > is another equivalent, but we are always > > talking about a matter of expression. > > > > > > How important is it to stick to > > depends on (FOO || !FOO) > > or its equivalents? > > > > > > If a driver wants to use the feature FOO > > in most usecases, 'depends on FOO' is sensible. > > > > If FOO is just optional, you can get rid of the dependency, > > and IS_REACHABLE() will do logically correct things. > > If by logically correct you mean the kernel builds, you're > right. However the proliferation of IS_REACHABLE() is making the kernel > config *harder* to understand. User enables FOO=m and expects BAR to use > it, however if BAR=y it silently gets ignored. I have and I will oppose > adding IS_REACHABLE() usage to i915 because it's just silently accepting > configurations that should be flagged and forbidden at kconfig stage. +1 I wholeheartedly agree. In case of Ethernet drivers having higher layers of the stack not able to communicate with drivers is just broken IMHO.