mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix compile error with wifi & leds
@ 2008-04-26 20:34 Luca Tettamanti
  2008-04-26 23:26 ` Tomas Winkler
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Luca Tettamanti @ 2008-04-26 20:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-wireless, David S. Miller

Hi,
I encountered a build error with current git tree:

  CC [M]  net/mac80211/led.o
/home/kronos/src/linux-2.6.git/net/mac80211/led.c: In function 'ieee80211_led_init':
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:58: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:62: error: dereferencing pointer to incomplete type
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:63: error: implicit declaration of function 'led_trigger_register'
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:69: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:73: error: dereferencing pointer to incomplete type
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:80: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:84: error: dereferencing pointer to incomplete type
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:91: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:95: error: dereferencing pointer to incomplete type
/home/kronos/src/linux-2.6.git/net/mac80211/led.c: In function 'ieee80211_led_exit':
/home/kronos/src/linux-2.6.git/net/mac80211/led.c:106: error: implicit declaration of function 'led_trigger_unregister'
make[3]: *** [net/mac80211/led.o] Error 1
make[2]: *** [net/mac80211] Error 2
make[1]: *** [net] Error 2
make: *** [sub-make] Error 2

This has been caused by commit e82404ad612ebabc65d15c3d59b971cb35c3ff36
from David Miller:

 config IWL4965_LEDS
        bool "Enable LEDS features in iwl4965 driver"
-       depends on IWL4965 && MAC80211_LEDS && LEDS_CLASS
+       depends on IWL4965
+       select MAC80211_LEDS
+       select LEDS_CLASS


the problem is that MAC80211_LEDS *depends* on LEDS_TRIGGER but does not
_select_ it. IOW enabling IWL4965_LEDS enables MAC80211_LEDS which in
turn does not compile if LEDS_TRIGGER is not enabled.

LEDS_TRIGGER is not enough though, NEW_LEDS (which is a menuconfig
guarding the aforementioned symbol) must also be selected.

---

Since MAC80211_LEDS is selected by wireless drivers it must select its
own dependencies otherwise a build error may occur (kbuild will select
the symbol regardless of "depends" constraints).

Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com>

---

 net/mac80211/Kconfig |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 520a518..a24b459 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -73,7 +73,9 @@ config MAC80211_MESH

 config MAC80211_LEDS
 	bool "Enable LED triggers"
-	depends on MAC80211 && LEDS_TRIGGERS
+	depends on MAC80211
+	select NEW_LEDS
+	select LEDS_TRIGGERS
 	---help---
 	  This option enables a few LED triggers for different
 	  packet receive/transmit events.


Luca
-- 
Io sono un uomo che non deve chiedere mai. Di solito imploro.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-26 20:34 [PATCH] Fix compile error with wifi & leds Luca Tettamanti
@ 2008-04-26 23:26 ` Tomas Winkler
  2008-04-27  0:40 ` David Miller
  2008-04-28  7:45 ` Adrian Bunk
  2 siblings, 0 replies; 9+ messages in thread
From: Tomas Winkler @ 2008-04-26 23:26 UTC (permalink / raw)
  To: Luca Tettamanti; +Cc: linux-kernel, linux-wireless, David S. Miller

On Sat, Apr 26, 2008 at 11:34 PM, Luca Tettamanti <kronos.it@gmail.com> wrote:
> Hi,
>  I encountered a build error with current git tree:
>
>   CC [M]  net/mac80211/led.o
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c: In function 'ieee80211_led_init':
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:58: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:62: error: dereferencing pointer to incomplete type
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:63: error: implicit declaration of function 'led_trigger_register'
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:69: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:73: error: dereferencing pointer to incomplete type
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:80: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:84: error: dereferencing pointer to incomplete type
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:91: error: invalid application of 'sizeof' to incomplete type 'struct led_trigger'
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:95: error: dereferencing pointer to incomplete type
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c: In function 'ieee80211_led_exit':
>  /home/kronos/src/linux-2.6.git/net/mac80211/led.c:106: error: implicit declaration of function 'led_trigger_unregister'
>  make[3]: *** [net/mac80211/led.o] Error 1
>  make[2]: *** [net/mac80211] Error 2
>  make[1]: *** [net] Error 2
>  make: *** [sub-make] Error 2
>
>  This has been caused by commit e82404ad612ebabc65d15c3d59b971cb35c3ff36
>  from David Miller:
>
>   config IWL4965_LEDS
>         bool "Enable LEDS features in iwl4965 driver"
>  -       depends on IWL4965 && MAC80211_LEDS && LEDS_CLASS
>  +       depends on IWL4965
>  +       select MAC80211_LEDS
>  +       select LEDS_CLASS
>
>
>  the problem is that MAC80211_LEDS *depends* on LEDS_TRIGGER but does not
>  _select_ it. IOW enabling IWL4965_LEDS enables MAC80211_LEDS which in
>  turn does not compile if LEDS_TRIGGER is not enabled.
>
>  LEDS_TRIGGER is not enough though, NEW_LEDS (which is a menuconfig
>  guarding the aforementioned symbol) must also be selected.
>
>  ---
>
>  Since MAC80211_LEDS is selected by wireless drivers it must select its
>  own dependencies otherwise a build error may occur (kbuild will select
>  the symbol regardless of "depends" constraints).
>
>  Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com>
>
>  ---
>
>   net/mac80211/Kconfig |    4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
>  diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
>  index 520a518..a24b459 100644
>  --- a/net/mac80211/Kconfig
>  +++ b/net/mac80211/Kconfig
>  @@ -73,7 +73,9 @@ config MAC80211_MESH
>
>   config MAC80211_LEDS
>         bool "Enable LED triggers"
>  -       depends on MAC80211 && LEDS_TRIGGERS
>  +       depends on MAC80211
>  +       select NEW_LEDS
>  +       select LEDS_TRIGGERS
>         ---help---
>           This option enables a few LED triggers for different
>           packet receive/transmit events.
>

This one was already posted
Thanks
Tomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-26 20:34 [PATCH] Fix compile error with wifi & leds Luca Tettamanti
  2008-04-26 23:26 ` Tomas Winkler
@ 2008-04-27  0:40 ` David Miller
  2008-04-28  7:45 ` Adrian Bunk
  2 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2008-04-27  0:40 UTC (permalink / raw)
  To: kronos.it; +Cc: linux-kernel, linux-wireless

From: Luca Tettamanti <kronos.it@gmail.com>
Date: Sat, 26 Apr 2008 22:34:08 +0200

> Since MAC80211_LEDS is selected by wireless drivers it must select its
> own dependencies otherwise a build error may occur (kbuild will select
> the symbol regardless of "depends" constraints).
> 
> Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com>

There are various ways to solve this problem, and I'll adopt one of
them, perhaps your's, over the weekend.

Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-26 20:34 [PATCH] Fix compile error with wifi & leds Luca Tettamanti
  2008-04-26 23:26 ` Tomas Winkler
  2008-04-27  0:40 ` David Miller
@ 2008-04-28  7:45 ` Adrian Bunk
  2008-04-28  7:54   ` Adrian Bunk
  2 siblings, 1 reply; 9+ messages in thread
From: Adrian Bunk @ 2008-04-28  7:45 UTC (permalink / raw)
  To: Luca Tettamanti; +Cc: linux-kernel, linux-wireless, David S. Miller

Can you send the .config that gives this problem?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-28  7:45 ` Adrian Bunk
@ 2008-04-28  7:54   ` Adrian Bunk
  2008-04-28  8:16     ` Luca Tettamanti
  2008-04-28  8:18     ` Tomas Winkler
  0 siblings, 2 replies; 9+ messages in thread
From: Adrian Bunk @ 2008-04-28  7:54 UTC (permalink / raw)
  To: Luca Tettamanti; +Cc: linux-kernel, linux-wireless, David S. Miller

On Mon, Apr 28, 2008 at 10:45:31AM +0300, Adrian Bunk wrote:
> Can you send the .config that gives this problem?

Scrap that, I already got the problem (and your patch looks right).

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-28  7:54   ` Adrian Bunk
@ 2008-04-28  8:16     ` Luca Tettamanti
  2008-04-28  8:18     ` Tomas Winkler
  1 sibling, 0 replies; 9+ messages in thread
From: Luca Tettamanti @ 2008-04-28  8:16 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, linux-wireless, David S. Miller

On Mon, Apr 28, 2008 at 9:54 AM, Adrian Bunk <bunk@kernel.org> wrote:
> On Mon, Apr 28, 2008 at 10:45:31AM +0300, Adrian Bunk wrote:
>  > Can you send the .config that gives this problem?

Just select IWL4965_LEDS without enabling LEDS_TRIGGERS.

>  Scrap that, I already got the problem (and your patch looks right).

It works, yes - but I don't like it... NEW_LEDS enables the core code
of the leds driver but also enables/disables the compilation of the
whole driver/leds directory; *every* user of the led driver has to
select whatever config option it wants (e.g. LEDS_TRIGGERS) _plus_
NEW_LEDS, otherwise led code won't be compiled.
>From a quick inspection RT2{4,5}00PCI_LEDS
(driver/net/wireless/rt2x00) have the same problem, they select
LEDS_CLASS without enabling NEW_LEDS -> unresolved symbols :|
Maybe LEDS_* should also select NEW_LEDS?

Luca

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-28  7:54   ` Adrian Bunk
  2008-04-28  8:16     ` Luca Tettamanti
@ 2008-04-28  8:18     ` Tomas Winkler
  2008-04-28  8:20       ` Adrian Bunk
  1 sibling, 1 reply; 9+ messages in thread
From: Tomas Winkler @ 2008-04-28  8:18 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Luca Tettamanti, linux-kernel, linux-wireless, David S. Miller,
	Priit Laes

On Mon, Apr 28, 2008 at 10:54 AM, Adrian Bunk <bunk@kernel.org> wrote:
> On Mon, Apr 28, 2008 at 10:45:31AM +0300, Adrian Bunk wrote:
>  > Can you send the .config that gives this problem?
>
>  Scrap that, I already got the problem (and your patch looks right).
>
>

I think it's time to be applied so we won't get another 5 of them.
Please add also  Priit Laes <plaes@plaes.org>  as he was first to
provide a patch

Thanks
Tomas

>  cu

>  Adrian
>
>  --
>
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
>
>  --
>  To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>
> the body of a message to majordomo@vger.kernel.org
>  More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-28  8:18     ` Tomas Winkler
@ 2008-04-28  8:20       ` Adrian Bunk
  2008-04-28  8:29         ` Tomas Winkler
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Bunk @ 2008-04-28  8:20 UTC (permalink / raw)
  To: Tomas Winkler
  Cc: Luca Tettamanti, linux-kernel, linux-wireless, David S. Miller,
	Priit Laes

On Mon, Apr 28, 2008 at 11:18:08AM +0300, Tomas Winkler wrote:
> On Mon, Apr 28, 2008 at 10:54 AM, Adrian Bunk <bunk@kernel.org> wrote:
> > On Mon, Apr 28, 2008 at 10:45:31AM +0300, Adrian Bunk wrote:
> >  > Can you send the .config that gives this problem?
> >
> >  Scrap that, I already got the problem (and your patch looks right).
> >
> >
> 
> I think it's time to be applied so we won't get another 5 of them.
> Please add also  Priit Laes <plaes@plaes.org>  as he was first to
> provide a patch

David already sent a pull request that includes Luca's patch to Linus.

My question was due to me first misunderstanding what's happening here.

> Thanks
> Tomas

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix compile error with wifi & leds
  2008-04-28  8:20       ` Adrian Bunk
@ 2008-04-28  8:29         ` Tomas Winkler
  0 siblings, 0 replies; 9+ messages in thread
From: Tomas Winkler @ 2008-04-28  8:29 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Luca Tettamanti, linux-kernel, linux-wireless, David S. Miller,
	Priit Laes

On Mon, Apr 28, 2008 at 11:20 AM, Adrian Bunk <bunk@kernel.org> wrote:
> On Mon, Apr 28, 2008 at 11:18:08AM +0300, Tomas Winkler wrote:
>  > On Mon, Apr 28, 2008 at 10:54 AM, Adrian Bunk <bunk@kernel.org> wrote:
>  > > On Mon, Apr 28, 2008 at 10:45:31AM +0300, Adrian Bunk wrote:
>  > >  > Can you send the .config that gives this problem?
>  > >
>  > >  Scrap that, I already got the problem (and your patch looks right).
>  > >
>  > >
>  >
>  > I think it's time to be applied so we won't get another 5 of them.
>  > Please add also  Priit Laes <plaes@plaes.org>  as he was first to
>  > provide a patch
>
>  David already sent a pull request that includes Luca's patch to Linus.
>
>  My question was due to me first misunderstanding what's happening here.
>
I see... I wasn't subscribed so I missed that.
Anyhow what is happening is that I've assumed that 'select' is
transitive and selecting MAC80211_LEDs is enough.

Tomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-28  8:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-26 20:34 [PATCH] Fix compile error with wifi & leds Luca Tettamanti
2008-04-26 23:26 ` Tomas Winkler
2008-04-27  0:40 ` David Miller
2008-04-28  7:45 ` Adrian Bunk
2008-04-28  7:54   ` Adrian Bunk
2008-04-28  8:16     ` Luca Tettamanti
2008-04-28  8:18     ` Tomas Winkler
2008-04-28  8:20       ` Adrian Bunk
2008-04-28  8:29         ` Tomas Winkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®