* [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
@ 2010-12-29 15:14 Christoph Paasch
2010-12-29 16:19 ` Larry Finger
2010-12-29 16:46 ` Larry Finger
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Paasch @ 2010-12-29 15:14 UTC (permalink / raw)
To: linville; +Cc: Christoph Paasch, linux-wireless, chunkeey
The priv-variable is unused when compiling without CONFIG_P54_LEDS.
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
drivers/net/wireless/p54/main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 622d27b..a6802f5 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -611,7 +611,9 @@ EXPORT_SYMBOL_GPL(p54_init_common);
int p54_register_common(struct ieee80211_hw *dev, struct device *pdev)
{
+#ifdef CONFIG_P54_LEDS
struct p54_common *priv = dev->priv;
+#endif /* CONFIG_P54_LEDS */
int err;
err = ieee80211_register_hw(dev);
@@ -653,9 +655,9 @@ EXPORT_SYMBOL_GPL(p54_free_common);
void p54_unregister_common(struct ieee80211_hw *dev)
{
+#ifdef CONFIG_P54_LEDS
struct p54_common *priv = dev->priv;
-#ifdef CONFIG_P54_LEDS
p54_unregister_leds(priv);
#endif /* CONFIG_P54_LEDS */
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
2010-12-29 15:14 [PATCH] p54: fix compiler-warning when no P54_LEDS are configured Christoph Paasch
@ 2010-12-29 16:19 ` Larry Finger
2010-12-29 16:46 ` Larry Finger
1 sibling, 0 replies; 6+ messages in thread
From: Larry Finger @ 2010-12-29 16:19 UTC (permalink / raw)
To: Christoph Paasch; +Cc: linville, linux-wireless, chunkeey
On 12/29/2010 09:14 AM, Christoph Paasch wrote:
> The priv-variable is unused when compiling without CONFIG_P54_LEDS.
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> drivers/net/wireless/p54/main.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
> index 622d27b..a6802f5 100644
> --- a/drivers/net/wireless/p54/main.c
> +++ b/drivers/net/wireless/p54/main.c
> @@ -611,7 +611,9 @@ EXPORT_SYMBOL_GPL(p54_init_common);
>
> int p54_register_common(struct ieee80211_hw *dev, struct device *pdev)
> {
> +#ifdef CONFIG_P54_LEDS
> struct p54_common *priv = dev->priv;
> +#endif /* CONFIG_P54_LEDS */
> int err;
>
> err = ieee80211_register_hw(dev);
> @@ -653,9 +655,9 @@ EXPORT_SYMBOL_GPL(p54_free_common);
>
> void p54_unregister_common(struct ieee80211_hw *dev)
> {
> +#ifdef CONFIG_P54_LEDS
> struct p54_common *priv = dev->priv;
>
> -#ifdef CONFIG_P54_LEDS
> p54_unregister_leds(priv);
> #endif /* CONFIG_P54_LEDS */
>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
2010-12-29 15:14 [PATCH] p54: fix compiler-warning when no P54_LEDS are configured Christoph Paasch
2010-12-29 16:19 ` Larry Finger
@ 2010-12-29 16:46 ` Larry Finger
2010-12-29 17:16 ` Christoph Paasch
1 sibling, 1 reply; 6+ messages in thread
From: Larry Finger @ 2010-12-29 16:46 UTC (permalink / raw)
To: Christoph Paasch; +Cc: linville, linux-wireless, chunkeey
On 12/29/2010 09:14 AM, Christoph Paasch wrote:
> The priv-variable is unused when compiling without CONFIG_P54_LEDS.
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> drivers/net/wireless/p54/main.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
> index 622d27b..a6802f5 100644
> --- a/drivers/net/wireless/p54/main.c
> +++ b/drivers/net/wireless/p54/main.c
> @@ -611,7 +611,9 @@ EXPORT_SYMBOL_GPL(p54_init_common);
>
> int p54_register_common(struct ieee80211_hw *dev, struct device *pdev)
> {
> +#ifdef CONFIG_P54_LEDS
> struct p54_common *priv = dev->priv;
> +#endif /* CONFIG_P54_LEDS */
> int err;
>
> err = ieee80211_register_hw(dev);
> @@ -653,9 +655,9 @@ EXPORT_SYMBOL_GPL(p54_free_common);
>
> void p54_unregister_common(struct ieee80211_hw *dev)
> {
> +#ifdef CONFIG_P54_LEDS
> struct p54_common *priv = dev->priv;
>
> -#ifdef CONFIG_P54_LEDS
> p54_unregister_leds(priv);
> #endif /* CONFIG_P54_LEDS */
>
I was too quick to ACK this. The second hunk causes a compiler ERROR as priv is
needed in the mutex_destroy() calls.
NACK
Larry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
2010-12-29 16:46 ` Larry Finger
@ 2010-12-29 17:16 ` Christoph Paasch
2010-12-29 17:32 ` Larry Finger
2010-12-29 18:13 ` Johannes Berg
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Paasch @ 2010-12-29 17:16 UTC (permalink / raw)
To: Larry Finger; +Cc: linville, linux-wireless, chunkeey
On Wednesday, December 29, 2010 wrote Larry Finger:
> I was too quick to ACK this. The second hunk causes a compiler ERROR as
> priv is needed in the mutex_destroy() calls.
Oups, sorry. I did not have CONFIG_DEBUG_MUTEXES enabled when trying it out.
Thus the compile-error did not happen.
What about the following patch?
>From 5701b5f5ffbf0927025906e968c957f3b2292ece Mon Sep 17 00:00:00 2001
From: Christoph Paasch <christoph.paasch@uclouvain.be>
Date: Wed, 29 Dec 2010 12:40:43 +0100
Subject: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
The priv-variable is unused when compiling without CONFIG_P54_LEDS.
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
drivers/net/wireless/p54/main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 622d27b..56ea1ce 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -611,7 +611,9 @@ EXPORT_SYMBOL_GPL(p54_init_common);
int p54_register_common(struct ieee80211_hw *dev, struct device *pdev)
{
+#ifdef CONFIG_P54_LEDS
struct p54_common *priv = dev->priv;
+#endif /* CONFIG_P54_LEDS */
int err;
err = ieee80211_register_hw(dev);
@@ -653,7 +655,9 @@ EXPORT_SYMBOL_GPL(p54_free_common);
void p54_unregister_common(struct ieee80211_hw *dev)
{
+#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_P54_LEDS)
struct p54_common *priv = dev->priv;
+#endif
#ifdef CONFIG_P54_LEDS
p54_unregister_leds(priv);
--
1.7.1
--
Christoph Paasch
Research Assistant
IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain
www.rollerbulls.be
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
2010-12-29 17:16 ` Christoph Paasch
@ 2010-12-29 17:32 ` Larry Finger
2010-12-29 18:13 ` Johannes Berg
1 sibling, 0 replies; 6+ messages in thread
From: Larry Finger @ 2010-12-29 17:32 UTC (permalink / raw)
To: christoph.paasch; +Cc: linville, linux-wireless, chunkeey
On 12/29/2010 11:16 AM, Christoph Paasch wrote:
> On Wednesday, December 29, 2010 wrote Larry Finger:
>> I was too quick to ACK this. The second hunk causes a compiler ERROR as
>> priv is needed in the mutex_destroy() calls.
>
> Oups, sorry. I did not have CONFIG_DEBUG_MUTEXES enabled when trying it out.
> Thus the compile-error did not happen.
>
> What about the following patch?
It seems to be what is needed if the mutex_destroy() calls are compiled away.
> From 5701b5f5ffbf0927025906e968c957f3b2292ece Mon Sep 17 00:00:00 2001
> From: Christoph Paasch <christoph.paasch@uclouvain.be>
> Date: Wed, 29 Dec 2010 12:40:43 +0100
> Subject: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
>
> The priv-variable is unused when compiling without CONFIG_P54_LEDS.
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> drivers/net/wireless/p54/main.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
> index 622d27b..56ea1ce 100644
> --- a/drivers/net/wireless/p54/main.c
> +++ b/drivers/net/wireless/p54/main.c
> @@ -611,7 +611,9 @@ EXPORT_SYMBOL_GPL(p54_init_common);
>
> int p54_register_common(struct ieee80211_hw *dev, struct device *pdev)
> {
> +#ifdef CONFIG_P54_LEDS
> struct p54_common *priv = dev->priv;
> +#endif /* CONFIG_P54_LEDS */
> int err;
>
> err = ieee80211_register_hw(dev);
> @@ -653,7 +655,9 @@ EXPORT_SYMBOL_GPL(p54_free_common);
>
> void p54_unregister_common(struct ieee80211_hw *dev)
> {
> +#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_P54_LEDS)
> struct p54_common *priv = dev->priv;
> +#endif
>
> #ifdef CONFIG_P54_LEDS
> p54_unregister_leds(priv);
Larry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] p54: fix compiler-warning when no P54_LEDS are configured
2010-12-29 17:16 ` Christoph Paasch
2010-12-29 17:32 ` Larry Finger
@ 2010-12-29 18:13 ` Johannes Berg
1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2010-12-29 18:13 UTC (permalink / raw)
To: christoph.paasch; +Cc: Larry Finger, linville, linux-wireless, chunkeey
On Wed, 2010-12-29 at 18:16 +0100, Christoph Paasch wrote:
> +#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_P54_LEDS)
> struct p54_common *priv = dev->priv;
> +#endif
It seems a lot simpler to just add __maybe_unused...
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-29 18:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29 15:14 [PATCH] p54: fix compiler-warning when no P54_LEDS are configured Christoph Paasch
2010-12-29 16:19 ` Larry Finger
2010-12-29 16:46 ` Larry Finger
2010-12-29 17:16 ` Christoph Paasch
2010-12-29 17:32 ` Larry Finger
2010-12-29 18:13 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).