2008-10-06 13:58:14

by Rami Rosen

[permalink] [raw]
Subject: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.

When CONFIG_IWLWIFI_DEBUG is not set and CONFIG_IWLWIFI is set,
we get this compilation warning:
/wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c: In
function 'rs_free_sta':
/wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c:2425:
warning: unused variable 'priv'

This patch (against wireless-next-2.6 tree) fixes it.


Signed-off-by: Rami Rosen <[email protected]>


Attachments:
(No filename) (389.00 B)
patch1.txt (625.00 B)
Download all attachments

2008-10-06 15:11:42

by Rami Rosen

[permalink] [raw]
Subject: Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.

Hello,

> I prefer marking it.
> struct iwl_priv *priv = priv_r __maybe_unused;

First of all , in order to compile, this should be:
struct iwl_priv *priv __maybe_unused = priv_r;
instead of:
struct iwl_priv *priv = priv_r __maybe_unused;

Second, this is also a possible solution; looking at the function
immediately above in the same file (rs_clear() in iwl-agn-rs.c)
we can see the same usage of #ifdef CONFIG_IWLWIFI_DEBUG
and not __maybe_unused.
I wonder: does the "__maybe_unused" solution better than the #ifdef
solution in any aspect?

Regards,
Rami Rosen

On Mon, Oct 6, 2008 at 4:41 PM, Tomas Winkler <[email protected]> wrote:
> On Mon, Oct 6, 2008 at 3:58 PM, Rami Rosen <[email protected]> wrote:
>> When CONFIG_IWLWIFI_DEBUG is not set and CONFIG_IWLWIFI is set,
>> we get this compilation warning:
>> /wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c: In
>> function 'rs_free_sta':
>> /wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c:2425:
>> warning: unused variable 'priv'
>>
>> This patch (against wireless-next-2.6 tree) fixes it.
>>
>
> I prefer marking it.
> struct iwl_priv *priv = priv_r __maybe_unused;
>

2008-10-06 19:03:44

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.

On Mon, Oct 06, 2008 at 05:11:40PM +0200, Rami Rosen wrote:

> Second, this is also a possible solution; looking at the function
> immediately above in the same file (rs_clear() in iwl-agn-rs.c)
> we can see the same usage of #ifdef CONFIG_IWLWIFI_DEBUG
> and not __maybe_unused.
> I wonder: does the "__maybe_unused" solution better than the #ifdef
> solution in any aspect?

Yes.

--
John W. Linville Linux should be at the core
[email protected] of your literate lifestyle.

2008-10-06 14:41:23

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.

On Mon, Oct 6, 2008 at 3:58 PM, Rami Rosen <[email protected]> wrote:
> When CONFIG_IWLWIFI_DEBUG is not set and CONFIG_IWLWIFI is set,
> we get this compilation warning:
> /wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c: In
> function 'rs_free_sta':
> /wireless-next-2.6/drivers/net/wireless/iwlwifi/iwl-agn-rs.c:2425:
> warning: unused variable 'priv'
>
> This patch (against wireless-next-2.6 tree) fixes it.
>

I prefer marking it.
struct iwl_priv *priv = priv_r __maybe_unused;