Skip to contentSkip to conversation

ieee802154: trace: fix endian convertion

PATCH In review Alexander Aring 2 participants 2 messages Apr 29, 2015

Subsystems (2)
lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

PATCH 1/1 ieee802154: trace: fix endian convertion

This patch fix endian convertions for extended address and short address handling when TP_printk is called.

---
 net/ieee802154/trace.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/ieee802154/trace.h +3 -2
index 8ed9f97..5ac25eb 100644
@@ -58,7 +58,7 @@ TRACE_EVENT(802154_rdev_add_virtual_intf,
 	),
 	TP_printk(WPAN_PHY_PR_FMT ", virtual intf name: %s, type: %d, ea %llx",
 		  WPAN_PHY_PR_ARG, __get_str(vir_intf_name), __entry->type,
-		  __entry->extended_addr)
+		  __le64_to_cpu(__entry->extended_addr))
 );
 
 TRACE_EVENT(802154_rdev_del_virtual_intf,
@@ -138,7 +138,8 @@ DEFINE_EVENT_PRINT(802154_le16_template, 802154_rdev_set_short_addr,
 		 __le16 le16arg),
 	TP_ARGS(wpan_phy, wpan_dev, le16arg),
 	TP_printk(WPAN_PHY_PR_FMT ", " WPAN_DEV_PR_FMT ", sa: 0x%04x",
-		  WPAN_PHY_PR_ARG, WPAN_DEV_PR_ARG, __entry->le16arg)
+		  WPAN_PHY_PR_ARG, WPAN_DEV_PR_ARG,
+		  __le16_to_cpu(__entry->le16arg))
 );
 
 TRACE_EVENT(802154_rdev_set_backoff_exponent,
Signature · 1 line
2.3.6
#1 lore raw
Quoted 23 lines · Alexander Aring

This patch fix endian convertions for extended address and short address handling when TP_printk is called.

---
 net/ieee802154/trace.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/ieee802154/trace.h +1 -1
index 8ed9f97..5ac25eb 100644
@@ -58,7 +58,7 @@ TRACE_EVENT(802154_rdev_add_virtual_intf,
 	),
 	TP_printk(WPAN_PHY_PR_FMT ", virtual intf name: %s, type: %d, ea %llx",
 		  WPAN_PHY_PR_ARG, __get_str(vir_intf_name), __entry->type,
-		  __entry->extended_addr)
+		  __le64_to_cpu(__entry->extended_addr))
 );
 
 TRACE_EVENT(802154_rdev_del_virtual_intf,

net/ieee802154/trace.h DEFINE_EVENT_PRINT(802154_le16_template, 802154_rdev_set_short_addr, · line 145

Quoted 9 lines
net/ieee802154/trace.h +2 -1
@@ -138,7 +138,8 @@ DEFINE_EVENT_PRINT(802154_le16_template, 802154_rdev_set_short_addr,
 		 __le16 le16arg),
 	TP_ARGS(wpan_phy, wpan_dev, le16arg),
 	TP_printk(WPAN_PHY_PR_FMT ", " WPAN_DEV_PR_FMT ", sa: 0x%04x",
-		  WPAN_PHY_PR_ARG, WPAN_DEV_PR_ARG, __entry->le16arg)
+		  WPAN_PHY_PR_ARG, WPAN_DEV_PR_ARG,
+		  __le16_to_cpu(__entry->le16arg))
 );
 
 TRACE_EVENT(802154_rdev_set_backoff_exponent,

Argh - missed that one. ACK.
Cheers,
-- Guido