2021-02-10 01:21:55

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] PCI: Use subdir-ccflags-* to inherit debug flag

[+cc Masahiro, Michal, linux-kbuild, linux-kernel]

On Thu, Feb 04, 2021 at 07:30:15PM +0800, Yicong Yang wrote:
> From: Junhao He <[email protected]>
>
> Use subdir-ccflags-* instead of ccflags-* to inherit the debug
> settings from Kconfig when traversing subdirectories.
>
> Signed-off-by: Junhao He <[email protected]>
> Signed-off-by: Yicong Yang <[email protected]>

I applied this with Krzysztof's reviewed-by and the commit log below
to pci/misc for v5.12, thanks!

Feel free to copy or improve the commit log for use elsewhere.

> ---
> 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

commit e8e9aababe60 ("PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy")
Author: Junhao He <[email protected]>
Date: Thu Feb 4 19:30:15 2021 +0800

PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy

CONFIG_PCI_DEBUG=y adds -DDEBUG to CFLAGS, which enables things like
pr_debug() and dev_dbg() (and hence pci_dbg()). Previously we added
-DDEBUG for files in drivers/pci/, but not files in subdirectories of
drivers/pci/.

Add -DDEBUG to CFLAGS for all files below drivers/pci/ so CONFIG_PCI_DEBUG
applies to the entire hierarchy.

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Junhao He <[email protected]>
Signed-off-by: Yicong Yang <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Krzysztof Wilczyński <[email protected]>

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 11cc79411e2d..d62c4ac4ae1b 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


2021-02-10 01:43:00

by Krzysztof Wilczyński

[permalink] [raw]
Subject: Re: [PATCH] PCI: Use subdir-ccflags-* to inherit debug flag

Hi Bjorn,

Thank you! This looks great!

[...]
> commit e8e9aababe60 ("PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy")
> Author: Junhao He <[email protected]>
> Date: Thu Feb 4 19:30:15 2021 +0800
>
> PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy
>
> CONFIG_PCI_DEBUG=y adds -DDEBUG to CFLAGS, which enables things like
> pr_debug() and dev_dbg() (and hence pci_dbg()). Previously we added
> -DDEBUG for files in drivers/pci/, but not files in subdirectories of
> drivers/pci/.
>
> Add -DDEBUG to CFLAGS for all files below drivers/pci/ so CONFIG_PCI_DEBUG
> applies to the entire hierarchy.
>
> [bhelgaas: commit log]
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Junhao He <[email protected]>
> Signed-off-by: Yicong Yang <[email protected]>
> Signed-off-by: Bjorn Helgaas <[email protected]>
> Reviewed-by: Krzysztof Wilczyński <[email protected]>
>
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 11cc79411e2d..d62c4ac4ae1b 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

And thank you again, Yicong, for fixing this. Much appreciated.

Krzysztof

2021-02-10 09:39:13

by Yicong Yang

[permalink] [raw]
Subject: Re: [PATCH] PCI: Use subdir-ccflags-* to inherit debug flag

On 2021/2/10 5:25, Bjorn Helgaas wrote:
> [+cc Masahiro, Michal, linux-kbuild, linux-kernel]
>
> On Thu, Feb 04, 2021 at 07:30:15PM +0800, Yicong Yang wrote:
>> From: Junhao He <[email protected]>
>>
>> Use subdir-ccflags-* instead of ccflags-* to inherit the debug
>> settings from Kconfig when traversing subdirectories.
>>
>> Signed-off-by: Junhao He <[email protected]>
>> Signed-off-by: Yicong Yang <[email protected]>
>
> I applied this with Krzysztof's reviewed-by and the commit log below
> to pci/misc for v5.12, thanks!
>
> Feel free to copy or improve the commit log for use elsewhere.
>

thanks for improving the commit. i admit that i didn't make the it
clear enough. it's much better now.

Thanks,
Yicong

>> ---
>> 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
>
> commit e8e9aababe60 ("PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy")
> Author: Junhao He <[email protected]>
> Date: Thu Feb 4 19:30:15 2021 +0800
>
> PCI: Apply CONFIG_PCI_DEBUG to entire drivers/pci hierarchy
>
> CONFIG_PCI_DEBUG=y adds -DDEBUG to CFLAGS, which enables things like
> pr_debug() and dev_dbg() (and hence pci_dbg()). Previously we added
> -DDEBUG for files in drivers/pci/, but not files in subdirectories of
> drivers/pci/.
>
> Add -DDEBUG to CFLAGS for all files below drivers/pci/ so CONFIG_PCI_DEBUG
> applies to the entire hierarchy.
>
> [bhelgaas: commit log]
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Junhao He <[email protected]>
> Signed-off-by: Yicong Yang <[email protected]>
> Signed-off-by: Bjorn Helgaas <[email protected]>
> Reviewed-by: Krzysztof Wilczyński <[email protected]>
>
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 11cc79411e2d..d62c4ac4ae1b 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
>
> .
>