Skip to contentSkip to conversation

ieee802154: solve make C=2 warnings

PATCH In review Alexander Aring 2 participants 8 messages Nov 2, 2014

Subsystems (2)
lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

cover ieee802154: solve make C=2 warnings

This patch series fixes warning when building with "make C=2". This was reported by Marcel Holtmann which told me to run "make C=2" and solve these warnings. Most of the issues was forgotten includes and byte ordering handling.

Alexander Aring (6):
ieee802154: add missing ULL definition
ieee802154: fix byteorder issues
mac802154: fix byteorder issues
ieee802154: sysfs: add missing include
mac802154: cfg: add missing include
ieee802154: remove unnecessary functions

 include/linux/ieee802154.h |  4 +++-
 include/net/mac802154.h    |  6 +++---
 net/ieee802154/sysfs.c     |  1 +
 net/mac802154/cfg.c        |  1 +
 net/mac802154/iface.c      | 22 ----------------------
 5 files changed, 8 insertions(+), 26 deletions(-)
Signature · 1 line
2.1.3
author maintainer
#1 lore raw

PATCH 1/6 ieee802154: add missing ULL definition

Running make C=2 occurs warning:

constant 0xffffffffffffffff is so big it is unsigned long

This patch fix this warning by adding a ULL to the constant definitions.

---
 include/linux/ieee802154.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/ieee802154.h +2 -1
index 9bba5ca..9da7c01 100644
@@ -208,7 +208,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
 	 * This is currently a workaround because neighbor discovery can't
 	 * deal with short addresses types right now.
 	 */
-	return ((addr != 0x0000000000000000) || (addr != 0xffffffffffffffff));
+	return ((addr != 0x0000000000000000ULL) ||
+		(addr != 0xffffffffffffffffULL));
 }
 
 #endif /* LINUX_IEEE802154_H */
Signature · 1 line
2.1.3
author maintainer
#2 lore raw

PATCH 2/6 ieee802154: fix byteorder issues

In reply to Alexander Aring

This patch fix byteorder issues which occurs because we compare __le64 with an host byteorder value. Simple add a cpu_to_le64 to convert the host byteorder values to __le64.

---
 include/linux/ieee802154.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/ieee802154.h +3 -2
index 9da7c01..5d9e745 100644
@@ -24,6 +24,7 @@
 #define LINUX_IEEE802154_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #define IEEE802154_MTU			127
 #define IEEE802154_MIN_PSDU_LEN		5
@@ -208,8 +209,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
 	 * This is currently a workaround because neighbor discovery can't
 	 * deal with short addresses types right now.
 	 */
-	return ((addr != 0x0000000000000000ULL) ||
-		(addr != 0xffffffffffffffffULL));
+	return ((addr != cpu_to_le64(0x0000000000000000ULL)) ||
+		(addr != cpu_to_le64(0xffffffffffffffffULL)));
 }
 
 #endif /* LINUX_IEEE802154_H */
Signature · 1 line
2.1.3
author maintainer
#3 lore raw

PATCH 3/6 mac802154: fix byteorder issues

In reply to Alexander Aring

Running make C=2 occurs these warnings:

cast from restricted __be64
incorrect type in argument 1 (different base types) expected unsigned long long[unsigned] [usertype] val got restricted __be64 [usertype]<noident> cast from restricted __be64
cast to restricted __le64

This patch fix these warnings by forcing to __le64 type and using swabp64 instead swab64.

---
 include/net/mac802154.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/net/mac802154.h +3 -3
index c17acbd..8b0c26b 100644
@@ -215,12 +215,12 @@ struct ieee802154_ops {
 };
 
 /**
- * ieee802154_netdev_to_extended_addr - convert __be64 u8 pointer to __le64
+ * ieee802154_netdev_to_extended_addr - convert big endian 64 byte void pointer to __le64
  * @dev_addr: big endian address pointer like netdevice dev_addr attribute
  */
-static inline __le64 ieee802154_netdev_to_extended_addr(const u8 *dev_addr)
+static inline __le64 ieee802154_netdev_to_extended_addr(const void *dev_addr)
 {
-	return (__le64)swab64(*((__be64 *)dev_addr));
+	return (__force __le64)swab64p(dev_addr);
 }
 
 /* Basic interface to register ieee802154 hwice */
Signature · 1 line
2.1.3
author maintainer
#4 lore raw

PATCH 4/6 ieee802154: sysfs: add missing include

In reply to Alexander Aring

Running make C=2 occurs in warnings:

symbol 'wpan_phy_class' was not declared. Should it be static? symbol 'wpan_phy_sysfs_init' was not declared. Should it be static? symbol 'wpan_phy_sysfs_exit' wasnot declared. Should it be static?

This patch adds a missing include "sysfs.h" to solve these warnings.

---
 net/ieee802154/sysfs.c | 1 +
 1 file changed, 1 insertion(+)
net/ieee802154/sysfs.c +1 -0
index c6e0380..8819998 100644
@@ -18,6 +18,7 @@
 #include <net/cfg802154.h>
 
 #include "core.h"
+#include "sysfs.h"
 
 static inline struct cfg802154_registered_device *
 dev_to_rdev(struct device *dev)
Signature · 1 line
2.1.3
author maintainer
#5 lore raw

PATCH 5/6 mac802154: cfg: add missing include

In reply to Alexander Aring

Running make C=2 occurs warning:

symbol 'mac802154_config_ops' was not declared. Should it be static?

This patch adds a missing include in cfg.c to solve this warning.

---
 net/mac802154/cfg.c | 1 +
 1 file changed, 1 insertion(+)
net/mac802154/cfg.c +1 -0
index 75a5d25..0c69b44 100644
@@ -16,6 +16,7 @@
 #include <net/cfg802154.h>
 
 #include "ieee802154_i.h"
+#include "cfg.h"
 
 static struct net_device *
 ieee802154_add_iface_deprecated(struct wpan_phy *wpan_phy,
Signature · 1 line
2.1.3
author maintainer
#6 lore raw

PATCH 6/6 ieee802154: remove unnecessary functions

In reply to Alexander Aring

This patch fixes commit c7420c367d63a7e1414e010afb52c3837fd9134e ("mac802154: move mac_params functions into mac_cmd"). The mac_params functions wasn't deleted by this commit.

---
 net/mac802154/iface.c | 22 ----------------------
 1 file changed, 22 deletions(-)
net/mac802154/iface.c +0 -22
index ceedf3e..0c9d00c 100644
@@ -127,28 +127,6 @@ static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)
 	return mac802154_wpan_update_llsec(dev);
 }
 
-int mac802154_set_mac_params(struct net_device *dev,
-			     const struct ieee802154_mac_params *params)
-{
-	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
-
-	mutex_lock(&sdata->local->iflist_mtx);
-	sdata->mac_params = *params;
-	mutex_unlock(&sdata->local->iflist_mtx);
-
-	return 0;
-}
-
-void mac802154_get_mac_params(struct net_device *dev,
-			      struct ieee802154_mac_params *params)
-{
-	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
-
-	mutex_lock(&sdata->local->iflist_mtx);
-	*params = sdata->mac_params;
-	mutex_unlock(&sdata->local->iflist_mtx);
-}
-
 static int mac802154_slave_open(struct net_device *dev)
 {
 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
Signature · 1 line
2.1.3
#7 lore raw
In reply to Alexander Aring

Hi Alex,

Quoted 13 lines

This patch series fixes warning when building with "make C=2". This was reported by Marcel Holtmann which told me to run "make C=2" and solve these warnings. Most of the issues was forgotten includes and byte ordering handling.

Alexander Aring (6):
ieee802154: add missing ULL definition
ieee802154: fix byteorder issues
mac802154: fix byteorder issues
ieee802154: sysfs: add missing include
mac802154: cfg: add missing include
ieee802154: remove unnecessary functions

Quoted 6 lines
include/linux/ieee802154.h |  4 +++-
include/net/mac802154.h    |  6 +++---
net/ieee802154/sysfs.c     |  1 +
net/mac802154/cfg.c        |  1 +
net/mac802154/iface.c      | 22 ----------------------
5 files changed, 8 insertions(+), 26 deletions(-)

all 6 patches have been applied to bluetooth-next tree.

Regards

Marcel