Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1562887pxb; Thu, 4 Feb 2021 16:57:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBdH4WqZGVGRAjxNgMzTYg3wQMuyfI+uxhD6xny+l9VcITQ6y0zxQU6Zok55z6reJ6+yHs X-Received: by 2002:a17:906:854d:: with SMTP id h13mr1601231ejy.124.1612486648423; Thu, 04 Feb 2021 16:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612486648; cv=none; d=google.com; s=arc-20160816; b=Et55BC/BofKhxKg/TW9nRQ0MjePxwfoDqpHXT9dSj9sGMAiCcOLddl5vxk0vdE55ZK UVh488HbBLC5L7HZXk8NPRyvx1TkFbPF3W/w2qmQXAQmruNWPIviHUytMN0Evv6JNQtv FMZ4K9QEXFsv9BKgwKGVqO+B1kgSG+dN7jnzeBxNuhIvA8eexaeIrJqwfuWYSG19SgOS YbNwkPaFPH7U/gvjXhiCN8yEjYKE1mj2ZiUfMfNe9t3h5G4mR43+/clPxZQXfceY2rqO VozUBe93GEuqtofWO9lGPpdhNXNtV3CsGHTqhbs0jg0APCq4OpOYJAtC7pH7+2dUL6FU v2eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=+GWRVtwN9O5M8MtPauv1aBUzeHQPcv2006nUINGy16w=; b=qJdJUQzqaoWlOYChWDwAiv1WBaz78R/MZRLIygdEsPqDNYkGOTZ7GGID+gNMgGiraT Pxp3ZprCHw7glH7Z7IucFb0arHBudvLwfmujMVI1GWZd+rCDUTPjDzDr+UzCbZ9OtKbi pOJzfQPQ8td6Kl0bsKb2JT7XSJ8UTlSAipBbJvFPwrszVLW15vTKUy5O97bs4rDywCYC c1/WG4GkDcc2EkxIXnmQfd5Ilmq9YAhB9bUdviK2XAY5/mfJblDo6YnaZYAoFj3cg/lG c1GTMaJFWUbUdU3urdat7XPvwvg/2h+t8KcQ2rfYQDcUa1AHyeEuUANCl2ajH9GMJ+4A uMHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cFl9IIrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si4021949ejf.705.2021.02.04.16.57.03; Thu, 04 Feb 2021 16:57:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cFl9IIrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237815AbhBDQMc (ORCPT + 99 others); Thu, 4 Feb 2021 11:12:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:41962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237257AbhBDQLi (ORCPT ); Thu, 4 Feb 2021 11:11:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 947EC64E2C; Thu, 4 Feb 2021 16:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612455049; bh=r6oygDdZU2GXmNaLqeahpVj6BCG8uM0b/k8n/L7Sg1o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=cFl9IIrh6K8lBgtUSI0HuY7QLEgg8v1droBcE10QXq6cnnWG6+9mGMHrb7t/01UcG X1zHwTr1WafbzW/jwvx46OAXtr1+HcR2D/av+Udsl3vdbzTrsJuyiOHGL4XnhAHNah AHfkW5N6AOS+JJ1v6dWTi0yzNzsqnwNqENtIDsmwQdjJZ5PGYncoJMYai3g+mL7pEc YzKjH8Zxt6jy96UEI9xHDr+EeMJ29N13CFN9CohSCTIcYNHGGVgzAMYwTso2S4bjn7 eu1k3dRO7cTiAV8G843jmJ+QVKl6/UdAoZ1B9hmCCdCVS4EHNRJjO+sQx7xFwVxid0 D+j0hO8ksqXUg== Date: Thu, 4 Feb 2021 10:10:48 -0600 From: Bjorn Helgaas To: Yicong Yang Cc: linux-pci@vger.kernel.org, prime.zeng@huawei.com, linuxarm@openeuler.org, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: Use subdir-ccflags-* to inherit debug flag Message-ID: <20210204161048.GA68790@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1612438215-33105-1-git-send-email-yangyicong@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Masahiro, Michal, linux-kbuild, linux-kernel] On Thu, Feb 04, 2021 at 07:30:15PM +0800, Yicong Yang wrote: > From: Junhao He > > Use subdir-ccflags-* instead of ccflags-* to inherit the debug > settings from Kconfig when traversing subdirectories. So I guess the current behavior is: If CONFIG_PCI_DEBUG=y, add -DDEBUG to CFLAGS in the current directory, but not in any subdirectories and the behavior after this patch is: If CONFIG_PCI_DEBUG=y, add -DDEBUG to CFLAGS in the current directory and any subdirectories Is that right? That makes sense to me. I wonder if any other places have this issue? 'git grep "^ccflags.*-DDEBUG"' finds a few cases where subdirectories use their own debug config options, e.g., drivers/i2c/Makefile:ccflags-$(CONFIG_I2C_DEBUG_CORE) := -DDEBUG drivers/i2c/algos/Makefile:ccflags-$(CONFIG_I2C_DEBUG_ALGO) := -DDEBUG drivers/i2c/busses/Makefile:ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG drivers/i2c/muxes/Makefile:ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG But some have subdirectories that look like they probably should be included by using subdir-ccflags, e.g., drivers/base/Makefile:ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG drivers/base/power/Makefile:ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG # drivers/base/{firmware_loader,regmap,test}/ not included drivers/hwmon/Makefile:ccflags-$(CONFIG_HWMON_DEBUG_CHIP) := -DDEBUG # drivers/hwmon/{occ,pmbus}/ not included drivers/pps/Makefile:ccflags-$(CONFIG_PPS_DEBUG) := -DDEBUG drivers/pps/clients/Makefile:ccflags-$(CONFIG_PPS_DEBUG) := -DDEBUG # drivers/pps/generators/ not included There are many more places that add -DDEBUG to ccflags-y that *don't* have subdirectories. I wonder the default should be that we use subdir-ccflags all the time, and use ccflags only when we actually want different CONFIG_*_DEBUG options for subdirectories. > Signed-off-by: Junhao He > Signed-off-by: Yicong Yang > --- > drivers/pci/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index 11cc794..d62c4ac 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -36,4 +36,4 @@ obj-$(CONFIG_PCI_ENDPOINT) += endpoint/ > obj-y += controller/ > obj-y += switch/ > > -ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG > +subdir-ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG > -- > 2.8.1 >