summaryrefslogtreecommitdiff
path: root/net/mac802154
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-04-25 00:49:55 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-29 12:29:04 -0400
commit2c1bbbffa0b644fab4f91878cde0c2e8f52e2dcc (patch)
tree2b9efab1d5155c58fe2fb76116ec01f1df64161d /net/mac802154
parentf7a1dd6e3ad59f0cfd51da29dfdbfd54122c5916 (diff)
net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W
Change MAC802154_CHAN_NONE from ~(u8)0 to 0xff, or the comparison in mac802154_wpan_xmit() for ``chan == MAC802154_CHAN_NONE'' will not succeed. This bug can be boiled down to ``u8 foo = 0xff; if (foo == ~(u8)0) [...] else [...]'' where the condition will always take the else branch. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/mac802154.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac802154/mac802154.h b/net/mac802154/mac802154.h
index a4dcaf1dd4b6..703c1210d223 100644
--- a/net/mac802154/mac802154.h
+++ b/net/mac802154/mac802154.h
@@ -90,7 +90,7 @@ struct mac802154_sub_if_data {
#define MAC802154_MAX_XMIT_ATTEMPTS 3
-#define MAC802154_CHAN_NONE (~(u8)0) /* No channel is assigned */
+#define MAC802154_CHAN_NONE 0xff /* No channel is assigned */
extern struct ieee802154_reduced_mlme_ops mac802154_mlme_reduced;
extern struct ieee802154_mlme_ops mac802154_mlme_wpan;