diff mbox

[v2,6/6,media] Only descend into directory when CONFIG_MEDIA_SUPPORT is set

Message ID 20170105210158.14204-7-afd@ti.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Andrew Davis Jan. 5, 2017, 9:01 p.m. UTC
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 <afd@ti.com>
---
 drivers/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Arnd Bergmann Jan. 5, 2017, 9:42 p.m. UTC | #1
On Thursday, January 5, 2017 3:01:58 PM CET Andrew F. Davis wrote:
> @@ -109,7 +109,8 @@ obj-$(CONFIG_SERIO)         += input/serio/
>  obj-$(CONFIG_GAMEPORT)         += input/gameport/
>  obj-$(CONFIG_INPUT)            += input/
>  obj-$(CONFIG_RTC_LIB)          += rtc/
> -obj-y                          += i2c/ media/
> +obj-y                          += i2c/
> +obj-$(CONFIG_MEDIA_SUPPORT)    += media/
>  obj-$(CONFIG_PPS)              += pps/
>  obj-y                          += ptp/
>  obj-$(CONFIG_W1)               += w1/
> 

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
Andrew Davis Jan. 5, 2017, 10:35 p.m. UTC | #2
On 01/05/2017 03:42 PM, Arnd Bergmann wrote:
> On Thursday, January 5, 2017 3:01:58 PM CET Andrew F. Davis wrote:
>> @@ -109,7 +109,8 @@ obj-$(CONFIG_SERIO)         += input/serio/
>>  obj-$(CONFIG_GAMEPORT)         += input/gameport/
>>  obj-$(CONFIG_INPUT)            += input/
>>  obj-$(CONFIG_RTC_LIB)          += rtc/
>> -obj-y                          += i2c/ media/
>> +obj-y                          += i2c/
>> +obj-$(CONFIG_MEDIA_SUPPORT)    += media/
>>  obj-$(CONFIG_PPS)              += pps/
>>  obj-y                          += ptp/
>>  obj-$(CONFIG_W1)               += w1/
>>
> 
> 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
>
Arnd Bergmann Jan. 5, 2017, 11:12 p.m. UTC | #3
On Thursday, January 5, 2017 4:35:33 PM CET Andrew F. Davis wrote:
> On 01/05/2017 03:42 PM, Arnd Bergmann wrote:
> > On Thursday, January 5, 2017 3:01:58 PM CET Andrew F. Davis wrote:
> >> @@ -109,7 +109,8 @@ obj-$(CONFIG_SERIO)         += input/serio/
> >>  obj-$(CONFIG_GAMEPORT)         += input/gameport/
> >>  obj-$(CONFIG_INPUT)            += input/
> >>  obj-$(CONFIG_RTC_LIB)          += rtc/
> >> -obj-y                          += i2c/ media/
> >> +obj-y                          += i2c/
> >> +obj-$(CONFIG_MEDIA_SUPPORT)    += media/
> >>  obj-$(CONFIG_PPS)              += pps/
> >>  obj-y                          += ptp/
> >>  obj-$(CONFIG_W1)               += w1/
> >>
> > 
> > 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
diff mbox

Patch

diff --git a/drivers/Makefile b/drivers/Makefile
index 59d6e0f5643d..9ccec4924ad1 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -109,7 +109,8 @@  obj-$(CONFIG_SERIO)		+= input/serio/
 obj-$(CONFIG_GAMEPORT)		+= input/gameport/
 obj-$(CONFIG_INPUT)		+= input/
 obj-$(CONFIG_RTC_LIB)		+= rtc/
-obj-y				+= i2c/ media/
+obj-y				+= i2c/
+obj-$(CONFIG_MEDIA_SUPPORT)	+= media/
 obj-$(CONFIG_PPS)		+= pps/
 obj-y				+= ptp/
 obj-$(CONFIG_W1)		+= w1/