From: Andrew F. Davis <hidden> Date: 2017-01-05 21:16:29
Hello all,
I was building a kernel for x86 and noticed Make still descended into
directories like drivers/gpu/drm/hisilicon, this seems kind of odd given
nothing will be built here. It looks to be due to some directories being
included in obj-y unconditionally instead of only when the relevant
CONFIG_ is set.
These patches are split by subsystem in-case, for some reason, a file in
a directory does need to be built, I believe I have checked for all
instances of this, but a quick review from some maintainers would be nice.
Thanks,
Andrew
Changes from v1:
- Removed patches already taken by maintainers
- Rebased on v4.10-rc1 (no changes needed)
Andrew F. Davis (6):
pwm: Only descend into pwm directory when CONFIG_PWM is set
amba: Only descend into amba directory when CONFIG_ARM_AMBA is set
NFC: Only descend into nfc directory when CONFIG_NFC is set
macintosh: Only descend into directory when CONFIG_MACINTOSH_DRIVERS
is set
auxdisplay: Only descend into directory when CONFIG_AUXDISPLAY is set
[media] Only descend into directory when CONFIG_MEDIA_SUPPORT is set
drivers/Makefile | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
--
2.11.0
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:16:12
When CONFIG_PWM is not set make will still descend into the pwm
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -13,7 +13,7 @@ obj-$(CONFIG_GENERIC_PHY) += phy/# GPIO must come after pinctrl as gpios may need to mux pins etcobj-$(CONFIG_PINCTRL)+=pinctrl/obj-$(CONFIG_GPIOLIB)+=gpio/-obj-y+=pwm/+obj-$(CONFIG_PWM)+=pwm/obj-$(CONFIG_PCI)+=pci/obj-$(CONFIG_PARISC)+=parisc/obj-$(CONFIG_RAPIDIO)+=rapidio/
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:16:13
When CONFIG_ARM_AMBA is not set make will still descend into the amba
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -28,7 +28,7 @@ obj-$(CONFIG_SFI) += sfi/# PnP must come after ACPI since it will eventually need to check if acpi# was used and do nothing if soobj-$(CONFIG_PNP)+=pnp/-obj-y+=amba/+obj-$(CONFIG_ARM_AMBA)+=amba/obj-y+=clk/# Many drivers will want to use DMA so this has to be made available
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:19:56
When CONFIG_NFC is not set make will still descend into the nfc
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:26:55
When CONFIG_AUXDISPLAY is not set make will still descend into the
auxdisplay directory but nothing will be built. This produces unneeded
build artifacts and messages in addition to slowing the build.
Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:26:57
When CONFIG_MEDIA_SUPPORT is not set make will still descend into the
media directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-01-05 21:26:58
When CONFIG_MACINTOSH_DRIVERS is not set make will still descend into the
macintosh directory but nothing will be built. This produces unneeded
build artifacts and messages in addition to slowing the build.
Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
This one seems wrong: if CONFIG_MEDIA_SUPPORT=m, but some I2C drivers
inside of drivers/media/ are built-in, we will fail to enter the directory,
see drivers/media/Makefile.
I checked the other five patches in the series as well, they all look
ok to me.
Arnd
This one seems wrong: if CONFIG_MEDIA_SUPPORT=m, but some I2C drivers
inside of drivers/media/ are built-in, we will fail to enter the directory,
see drivers/media/Makefile.
Not sure if I see this, it looks like everything in drivers/media/
depends on CONFIG_MEDIA_SUPPORT (directly or indirectly). If
CONFIG_MEDIA_SUPPORT is =m then all dependents should be locked out of
being built-in.
Any bool symbol that controls compilation of source that depends on a
tristate symbol is broken and should be fixed anyway.
I checked the other five patches in the series as well, they all look
ok to me.
Arnd
This one seems wrong: if CONFIG_MEDIA_SUPPORT=m, but some I2C drivers
inside of drivers/media/ are built-in, we will fail to enter the directory,
see drivers/media/Makefile.
Not sure if I see this, it looks like everything in drivers/media/
depends on CONFIG_MEDIA_SUPPORT (directly or indirectly). If
CONFIG_MEDIA_SUPPORT is =m then all dependents should be locked out of
being built-in.
Any bool symbol that controls compilation of source that depends on a
tristate symbol is broken and should be fixed anyway.
I don't think it's this easy, we have a couple of cases where that doesn't
work. I have not looked at the media example in detail, but at least it
looks intentional.
Note that drivers/media is rather creative with expressing dependencies.
Arnd