* [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.
@ 2008-10-06 13:58 Rami Rosen
2008-10-06 14:41 ` Tomas Winkler
0 siblings, 1 reply; 4+ messages in thread
From: Rami Rosen @ 2008-10-06 13:58 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, yi.zhu
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
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 <ramirose@gmail.com>
[-- Attachment #2: patch1.txt --]
[-- Type: text/plain, Size: 625 bytes --]
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 93944de..1ed4397 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2422,11 +2422,15 @@ static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta,
void *priv_sta)
{
struct iwl_lq_sta *lq_sta = priv_sta;
+#ifdef CONFIG_IWLWIFI_DEBUG
struct iwl_priv *priv = priv_r;
IWL_DEBUG_RATE("enter\n");
+#endif /* CONFIG_IWLWIFI_DEBUG */
kfree(lq_sta);
+#ifdef CONFIG_IWLWIFI_DEBUG
IWL_DEBUG_RATE("leave\n");
+#endif /* CONFIG_IWLWIFI_DEBUG */
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.
2008-10-06 13:58 [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set Rami Rosen
@ 2008-10-06 14:41 ` Tomas Winkler
2008-10-06 15:11 ` Rami Rosen
0 siblings, 1 reply; 4+ messages in thread
From: Tomas Winkler @ 2008-10-06 14:41 UTC (permalink / raw)
To: Rami Rosen; +Cc: linville, linux-wireless, yi.zhu
On Mon, Oct 6, 2008 at 3:58 PM, Rami Rosen <ramirose@gmail.com> 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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.
2008-10-06 14:41 ` Tomas Winkler
@ 2008-10-06 15:11 ` Rami Rosen
2008-10-06 19:03 ` John W. Linville
0 siblings, 1 reply; 4+ messages in thread
From: Rami Rosen @ 2008-10-06 15:11 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linville, linux-wireless, yi.zhu
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 <tomasw@gmail.com> wrote:
> On Mon, Oct 6, 2008 at 3:58 PM, Rami Rosen <ramirose@gmail.com> 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;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set.
2008-10-06 15:11 ` Rami Rosen
@ 2008-10-06 19:03 ` John W. Linville
0 siblings, 0 replies; 4+ messages in thread
From: John W. Linville @ 2008-10-06 19:03 UTC (permalink / raw)
To: Rami Rosen; +Cc: Tomas Winkler, linux-wireless, yi.zhu
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
linville@tuxdriver.com of your literate lifestyle.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-06 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06 13:58 [PATCH 1/2] iwlwifi: fix compliation warning in iwl-agn-rs.c when CONFIG_IWLWIFI_DEBUG is not set Rami Rosen
2008-10-06 14:41 ` Tomas Winkler
2008-10-06 15:11 ` Rami Rosen
2008-10-06 19:03 ` John W. Linville
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).