ieee802154: solve make C=2 warnings
Subsystems (2)
Alexander Aring
maintainercover 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
Alexander Aring
maintainerPATCH 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
@@ -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
Alexander Aring
maintainerPATCH 2/6 ieee802154: fix byteorder issues
In reply to Alexander AringThis 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
@@ -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
Alexander Aring
maintainerPATCH 3/6 mac802154: fix byteorder issues
In reply to Alexander AringRunning 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
@@ -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
Alexander Aring
maintainerPATCH 4/6 ieee802154: sysfs: add missing include
In reply to Alexander AringRunning 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
@@ -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
Alexander Aring
maintainerPATCH 5/6 mac802154: cfg: add missing include
In reply to Alexander AringRunning 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
@@ -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
Alexander Aring
maintainerPATCH 6/6 ieee802154: remove unnecessary functions
In reply to Alexander AringThis 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
@@ -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
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