* [PATCH] mac80211: remove compilation warning on mesh
@ 2015-06-29 3:50 Chun-Yeow Yeoh
2015-06-29 7:27 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Chun-Yeow Yeoh @ 2015-06-29 3:50 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Chun-Yeow Yeoh
Remove the warning on the following:
mesh_hwmp.c: warning: ‘target_metric’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
net/mac80211/mesh_hwmp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index d80e0a4..1a1f652 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -530,7 +530,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
const u8 *target_addr, *orig_addr;
const u8 *da;
u8 target_flags, ttl, flags;
- u32 orig_sn, target_sn, lifetime, target_metric;
+ u32 orig_sn, target_sn, lifetime, target_metric = 0;
bool reply = false;
bool forward = true;
bool root_is_gate;
@@ -551,7 +551,6 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
mhwmp_dbg(sdata, "PREQ is for us\n");
forward = false;
reply = true;
- target_metric = 0;
if (time_after(jiffies, ifmsh->last_sn_update +
net_traversal_jiffies(sdata)) ||
time_before(jiffies, ifmsh->last_sn_update)) {
@@ -568,7 +567,6 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
reply = true;
target_addr = sdata->vif.addr;
target_sn = ++ifmsh->sn;
- target_metric = 0;
ifmsh->last_sn_update = jiffies;
}
if (root_is_gate)
--
2.3.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: remove compilation warning on mesh
2015-06-29 3:50 [PATCH] mac80211: remove compilation warning on mesh Chun-Yeow Yeoh
@ 2015-06-29 7:27 ` Johannes Berg
2015-06-29 7:41 ` Yeoh Chun-Yeow
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2015-06-29 7:27 UTC (permalink / raw)
To: Chun-Yeow Yeoh, linux-wireless
On Mon, 2015-06-29 at 11:50 +0800, Chun-Yeow Yeoh wrote:
> Remove the warning on the following:
> mesh_hwmp.c: warning: ‘target_metric’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>
I don't see any such warning, and would prefer not to have a blanket
initialization that might in the future suppress a valid warning.
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: remove compilation warning on mesh
2015-06-29 7:27 ` Johannes Berg
@ 2015-06-29 7:41 ` Yeoh Chun-Yeow
2015-06-29 7:56 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Yeoh Chun-Yeow @ 2015-06-29 7:41 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Mon, Jun 29, 2015 at 3:27 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2015-06-29 at 11:50 +0800, Chun-Yeow Yeoh wrote:
>> Remove the warning on the following:
>> mesh_hwmp.c: warning: ‘target_metric’ may be used
>> uninitialized in this function [-Wmaybe-uninitialized]
>>
> I don't see any such warning, and would prefer not to have a blanket
> initialization that might in the future suppress a valid warning.
>
Ok, noted.
FYI, I have compiled backports-20150626 and observed this warning.
----
Chun-Yeow
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: remove compilation warning on mesh
2015-06-29 7:41 ` Yeoh Chun-Yeow
@ 2015-06-29 7:56 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2015-06-29 7:56 UTC (permalink / raw)
To: Yeoh Chun-Yeow; +Cc: linux-wireless
On Mon, 2015-06-29 at 15:41 +0800, Yeoh Chun-Yeow wrote:
> On Mon, Jun 29, 2015 at 3:27 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Mon, 2015-06-29 at 11:50 +0800, Chun-Yeow Yeoh wrote:
> > > Remove the warning on the following:
> > > mesh_hwmp.c: warning: ‘target_metric’ may be used
> > > uninitialized in this function [-Wmaybe-uninitialized]
> > >
> > I don't see any such warning, and would prefer not to have a
> > blanket
> > initialization that might in the future suppress a valid warning.
> >
>
> Ok, noted.
>
> FYI, I have compiled backports-20150626 and observed this warning
>
It probably depends on the compiler version?
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-29 7:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 3:50 [PATCH] mac80211: remove compilation warning on mesh Chun-Yeow Yeoh
2015-06-29 7:27 ` Johannes Berg
2015-06-29 7:41 ` Yeoh Chun-Yeow
2015-06-29 7:56 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.