2011-03-05 09:40:48

by Jovi Zhang

[permalink] [raw]
Subject: [PATCH] net: mac80211: fix compilation warning

From: Jovi Zhang <[email protected]>

this commit fix compilation warning as following:
net/mac80211/tx.c:1753: warning: unused variable mppath

Signed-off-by: Jovi Zhang <[email protected]>
---
net/mac80211/tx.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b0beaa5..e87b07f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1750,7 +1750,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
__le16 fc;
struct ieee80211_hdr hdr;
struct ieee80211s_hdr mesh_hdr __maybe_unused;
- struct mesh_path *mppath = NULL;
const u8 *encaps_data;
int encaps_len, skip_header_bytes;
int nh_pos, h_pos;
@@ -1805,6 +1804,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
break;
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
+ struct mesh_path *mppath = NULL;
+
if (!sdata->u.mesh.mshcfg.dot11MeshTTL) {
/* Do not send frames with mesh_ttl == 0 */
sdata->u.mesh.mshstats.dropped_frames_ttl++;
--
1.7.2.3



2011-03-05 13:52:01

by Jovi Zhang

[permalink] [raw]
Subject: Re: [PATCH] net: mac80211: fix compilation warning

On Sat, Mar 5, 2011 at 8:31 PM, Ben Hutchings <[email protected]> wrote:
> On Wed, 2011-03-02 at 18:32 -0500, [email protected] wrote:
>> From: Jovi Zhang <[email protected]>
>>
>> this commit fix compilation warning as following:
>> net/mac80211/tx.c:1753: warning: unused variable mppath
> [...]
>
> You clearly didn't try building this with CONFIG_MAC80211_MESH enabled.
>
Sorry, indeed, maybe should be like this:

+#ifdef CONFIG_MAC80211_MESH
       struct mesh_path *mppath = NULL;
+#endif

2011-03-05 12:31:05

by Ben Hutchings

[permalink] [raw]
Subject: Re: [PATCH] net: mac80211: fix compilation warning

On Wed, 2011-03-02 at 18:32 -0500, [email protected] wrote:
> From: Jovi Zhang <[email protected]>
>
> this commit fix compilation warning as following:
> net/mac80211/tx.c:1753: warning: unused variable mppath
[...]

You clearly didn't try building this with CONFIG_MAC80211_MESH enabled.

Ben.

--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


2011-03-07 04:15:03

by Jovi Zhang

[permalink] [raw]
Subject: Re: [PATCH] net: mac80211: fix compilation warning

On Sun, Mar 6, 2011 at 12:30 AM, Larry Finger <[email protected]> wrote:
> On 03/05/2011 07:52 AM, Jovi Zhang wrote:
>>
>> On Sat, Mar 5, 2011 at 8:31 PM, Ben Hutchings<[email protected]>
>>  wrote:
>>>
>>> On Wed, 2011-03-02 at 18:32 -0500, [email protected] wrote:
>>>>
>>>> From: Jovi Zhang<[email protected]>
>>>>
>>>> this commit fix compilation warning as following:
>>>> net/mac80211/tx.c:1753: warning: unused variable mppath
>>>
>>> [...]
>>>
>>> You clearly didn't try building this with CONFIG_MAC80211_MESH enabled.
>>>
>> Sorry, indeed, maybe should be like this:
>>
>> +#ifdef CONFIG_MAC80211_MESH
>>        struct mesh_path *mppath = NULL;
>> +#endif
>
> Linville likes "struct mesh_path *mppath __maybe_unused = NULL;" over the
> ifdef form.

That's better, Thanks.

2011-03-05 16:30:12

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] net: mac80211: fix compilation warning

On 03/05/2011 07:52 AM, Jovi Zhang wrote:
> On Sat, Mar 5, 2011 at 8:31 PM, Ben Hutchings<[email protected]> wrote:
>> On Wed, 2011-03-02 at 18:32 -0500, [email protected] wrote:
>>> From: Jovi Zhang<[email protected]>
>>>
>>> this commit fix compilation warning as following:
>>> net/mac80211/tx.c:1753: warning: unused variable mppath
>> [...]
>>
>> You clearly didn't try building this with CONFIG_MAC80211_MESH enabled.
>>
> Sorry, indeed, maybe should be like this:
>
> +#ifdef CONFIG_MAC80211_MESH
> struct mesh_path *mppath = NULL;
> +#endif

Linville likes "struct mesh_path *mppath __maybe_unused = NULL;" over the ifdef
form.

Larry