Re: [PATCH v2] staging: rtl8712: rtl8712: fix sparse warnings
On Wed, Feb 08, 2017 at 01:23:15AM +, Carlos Palminha wrote: > Fixed sparse warnings > * No need to convert from le32, pointers for structure with same endianness > (cast from restricted __le32) > * Need to convert bitwise operation for le32 structure (invalid assignment > from int to __le32) > > Signed-off-by: Carlos Palminha> --- > Changes v1->v2: > * Clarify patch description to ensure confidence > > drivers/staging/rtl8712/rtl8712_xmit.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c > b/drivers/staging/rtl8712/rtl8712_xmit.c > index c4f03a602a2e..67713643c923 100644 > --- a/drivers/staging/rtl8712/rtl8712_xmit.c > +++ b/drivers/staging/rtl8712/rtl8712_xmit.c > @@ -561,19 +561,19 @@ static void update_txdesc(struct xmit_frame > *pxmitframe, uint *pmem, int sz) > > ptxdesc_mp = _mp; > /* offset 8 */ > - ptxdesc->txdw2 = cpu_to_le32(ptxdesc_mp->txdw2); > + ptxdesc->txdw2 = ptxdesc_mp->txdw2; Nah... The original is done deliberately. When I'm reviewing this patch I can see that now. Just leave this as-is. regards, dan carpenter
Re: [PATCH v2] staging: rtl8712: rtl8712: fix sparse warnings
On Wed, Feb 08, 2017 at 01:23:15AM +, Carlos Palminha wrote: > Fixed sparse warnings > * No need to convert from le32, pointers for structure with same endianness > (cast from restricted __le32) > * Need to convert bitwise operation for le32 structure (invalid assignment > from int to __le32) > > Signed-off-by: Carlos Palminha > --- > Changes v1->v2: > * Clarify patch description to ensure confidence > > drivers/staging/rtl8712/rtl8712_xmit.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c > b/drivers/staging/rtl8712/rtl8712_xmit.c > index c4f03a602a2e..67713643c923 100644 > --- a/drivers/staging/rtl8712/rtl8712_xmit.c > +++ b/drivers/staging/rtl8712/rtl8712_xmit.c > @@ -561,19 +561,19 @@ static void update_txdesc(struct xmit_frame > *pxmitframe, uint *pmem, int sz) > > ptxdesc_mp = _mp; > /* offset 8 */ > - ptxdesc->txdw2 = cpu_to_le32(ptxdesc_mp->txdw2); > + ptxdesc->txdw2 = ptxdesc_mp->txdw2; Nah... The original is done deliberately. When I'm reviewing this patch I can see that now. Just leave this as-is. regards, dan carpenter
[PATCH v2] staging: rtl8712: rtl8712: fix sparse warnings
Fixed sparse warnings * No need to convert from le32, pointers for structure with same endianness (cast from restricted __le32) * Need to convert bitwise operation for le32 structure (invalid assignment from int to __le32) Signed-off-by: Carlos Palminha--- Changes v1->v2: * Clarify patch description to ensure confidence drivers/staging/rtl8712/rtl8712_xmit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index c4f03a602a2e..67713643c923 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -561,19 +561,19 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz) ptxdesc_mp = _mp; /* offset 8 */ - ptxdesc->txdw2 = cpu_to_le32(ptxdesc_mp->txdw2); + ptxdesc->txdw2 = ptxdesc_mp->txdw2; if (bmcst) ptxdesc->txdw2 |= cpu_to_le32(BMC); ptxdesc->txdw2 |= cpu_to_le32(BK); /* offset 16 */ - ptxdesc->txdw4 = cpu_to_le32(ptxdesc_mp->txdw4); + ptxdesc->txdw4 = ptxdesc_mp->txdw4; /* offset 20 */ - ptxdesc->txdw5 = cpu_to_le32(ptxdesc_mp->txdw5); + ptxdesc->txdw5 = ptxdesc_mp->txdw5; pattrib->pctrl = 0;/* reset to zero; */ } } 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 & 0x001f); ptxdesc->txdw1 |= cpu_to_le32((qsel << QSEL_SHT) & 0x1f00); ptxdesc->txdw1 |= cpu_to_le32(BIT(16));/* Non-QoS */ -- 2.11.0
[PATCH v2] staging: rtl8712: rtl8712: fix sparse warnings
Fixed sparse warnings * No need to convert from le32, pointers for structure with same endianness (cast from restricted __le32) * Need to convert bitwise operation for le32 structure (invalid assignment from int to __le32) Signed-off-by: Carlos Palminha --- Changes v1->v2: * Clarify patch description to ensure confidence drivers/staging/rtl8712/rtl8712_xmit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index c4f03a602a2e..67713643c923 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -561,19 +561,19 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz) ptxdesc_mp = _mp; /* offset 8 */ - ptxdesc->txdw2 = cpu_to_le32(ptxdesc_mp->txdw2); + ptxdesc->txdw2 = ptxdesc_mp->txdw2; if (bmcst) ptxdesc->txdw2 |= cpu_to_le32(BMC); ptxdesc->txdw2 |= cpu_to_le32(BK); /* offset 16 */ - ptxdesc->txdw4 = cpu_to_le32(ptxdesc_mp->txdw4); + ptxdesc->txdw4 = ptxdesc_mp->txdw4; /* offset 20 */ - ptxdesc->txdw5 = cpu_to_le32(ptxdesc_mp->txdw5); + ptxdesc->txdw5 = ptxdesc_mp->txdw5; pattrib->pctrl = 0;/* reset to zero; */ } } 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 & 0x001f); ptxdesc->txdw1 |= cpu_to_le32((qsel << QSEL_SHT) & 0x1f00); ptxdesc->txdw1 |= cpu_to_le32(BIT(16));/* Non-QoS */ -- 2.11.0