Skip to contentSkip to conversation

staging: rtl8712: rtl8712: fixed missing conversion to le32

PATCH In review Carlos Palminha 2 participants 2 messages Feb 9, 2017 – Feb 10, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8712: rtl8712: fixed missing conversion to le32

Fixed missing conversion to le32, detected by sparse (invalid assignment from int to __le32)

---
v1->v2:
missed sob line (too late in the night...)

 drivers/staging/rtl8712/rtl8712_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl8712_xmit.c +1 -1
index 041508d6ec6d..4231a0a83097 100644
@@ -573,7 +573,7 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz)
 		}
 	} else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
 		/* offset 4 */
-		ptxdesc->txdw1 |= (0x05) & 0x1f;/*CAM_ID(MAC_ID), default=5;*/
+		ptxdesc->txdw1 |= cpu_to_le32((0x05) & 0x1f);/*CAM_ID(MAC_ID), default=5;*/
 		qsel = (uint)(pattrib->qsel & 0x0000001f);
 		ptxdesc->txdw1 |= cpu_to_le32((qsel << QSEL_SHT) & 0x00001f00);
 		ptxdesc->txdw1 |= cpu_to_le32(BIT(16));/* Non-QoS */

--
2.11.0

#1 lore raw
Quoted 16 lines · Carlos Palminha

Fixed missing conversion to le32, detected by sparse (invalid assignment from int to __le32)

---
v1->v2:
missed sob line (too late in the night...)

 drivers/staging/rtl8712/rtl8712_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl8712_xmit.c +0 -0
index 041508d6ec6d..4231a0a83097 100644

drivers/staging/rtl8712/rtl8712_xmit.c static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz) · line 576

Quoted 5 lines
drivers/staging/rtl8712/rtl8712_xmit.c +1 -1
@@ -573,7 +573,7 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz)
 		}
 	} else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
 		/* offset 4 */
-		ptxdesc->txdw1 |= (0x05) & 0x1f;/*CAM_ID(MAC_ID), default=5;*/
+		ptxdesc->txdw1 |= cpu_to_le32((0x05) & 0x1f);/*CAM_ID(MAC_ID), default=5;*/

This looks reasonable but it's probably cleaner to say something like:

		ptxdesc->txdw1 |= cpu_to_le32(0x05); /*CAM_ID(MAC_ID), default=5;*/

regards,
dan carpenter