net: qrtr: Mark 'buf' as little endian
Subsystems (3)
PATCH 1/1 net: qrtr: Mark 'buf' as little endian
Failure to mark this pointer as __le32 causes checkers like sparse to complain:
net/qrtr/qrtr.c:274:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:274:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:274:16: got restricted __le32 [usertype] <noident>net/qrtr/qrtr.c:275:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:275:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:275:16: got restricted __le32 [usertype] <noident>net/qrtr/qrtr.c:276:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:276:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:276:16: got restricted __le32 [usertype] <noident>
Silence it.
--- net/qrtr/qrtr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/qrtr/qrtr.c +2 -2
@@ -252,7 +252,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node,const int pkt_len =20 ;struct qrtr_hdr *hdr;struct sk_buff *skb; -u32 *buf; +__le32 *buf; skb =alloc_skb (QRTR_HDR_SIZE + pkt_len,GFP_KERNEL );if (!skb)
@@ -269,7 +269,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node, hdr->dst_node_id =cpu_to_le32 (dst_node); hdr->dst_port_id =cpu_to_le32 (QRTR_PORT_CTRL ); - buf = (u32 *)skb_put (skb, pkt_len); + buf = (__le32 *)skb_put (skb, pkt_len);memset (buf,0 , pkt_len); buf[0 ] =cpu_to_le32 (QRTR_TYPE_RESUME_TX ); buf[1 ] =cpu_to_le32 (src_node);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 13 lines · Stephen Boyd
Failure to mark this pointer as
__le32causes checkers like sparse to complain:
net/qrtr/qrtr.c:274:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:274:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:274:16: got restricted__le32[usertype] <noident>net/qrtr/qrtr.c:275:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:275:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:275:16: got restricted__le32[usertype] <noident>net/qrtr/qrtr.c:276:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:276:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:276:16: got restricted__le32[usertype] <noident>
Quoted 3 lines
Silence it.
Cc Bjorn Andersson <[email protected]>
Regards,
Bjorn
Quoted 31 lines
Signed-off-by Stephen Boyd <[email protected]>--- net/qrtr/qrtr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/qrtr/qrtr.c +2
-2@@ -252,7 +252,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node,const int pkt_len =20 ;struct qrtr_hdr *hdr;struct sk_buff *skb; -u32 *buf; +__le32 *buf; skb =alloc_skb (QRTR_HDR_SIZE + pkt_len,GFP_KERNEL );if (!skb)@@ -269,7 +269,7 @@ static struct sk_buff *qrtr_alloc_resume_tx(u32 src_node, hdr->dst_node_id =cpu_to_le32 (dst_node); hdr->dst_port_id =cpu_to_le32 (QRTR_PORT_CTRL ); - buf = (u32 *)skb_put (skb, pkt_len); + buf = (__le32 *)skb_put (skb, pkt_len);memset (buf,0 , pkt_len); buf[0 ] =cpu_to_le32 (QRTR_TYPE_RESUME_TX ); buf[1 ] =cpu_to_le32 (src_node);Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
From: Stephen Boyd <[email protected]>
Date: Mon, 9 Jan 2017 14:31:58 -0800
Quoted 13 lines
Failure to mark this pointer as
__le32causes checkers like sparse to complain:
net/qrtr/qrtr.c:274:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:274:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:274:16: got restricted__le32[usertype] <noident>net/qrtr/qrtr.c:275:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:275:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:275:16: got restricted__le32[usertype] <noident>net/qrtr/qrtr.c:276:16: warning: incorrect type in assignment (different base types)net/qrtr/qrtr.c:276:16: expected unsigned int [unsigned] [usertype] <noident>net/qrtr/qrtr.c:276:16: got restricted__le32[usertype] <noident>
Quoted 4 lines
Silence it.
Cc Bjorn Andersson <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Applied, thanks.