LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16"
@ 2015-04-02 9:37 Piotr Witoslawski
2015-04-02 10:07 ` Dan Carpenter
2015-04-02 13:37 ` [PATCH v2] " Piotr Witoslawski
0 siblings, 2 replies; 4+ messages in thread
From: Piotr Witoslawski @ 2015-04-02 9:37 UTC (permalink / raw)
To: Larry Finger
Cc: Jes Sorensen, Greg Kroah-Hartman, Yannis Damigos, linux-wireless,
devel, linux-kernel
Signed-off-by: Piotr Witoslawski <pwitos@gmail.com>
---
drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index 1759487..256958e 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -51,7 +51,8 @@ static void rtl8192cu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
for (index = 0 ; index < count ; index++)
- checksum = checksum ^ le16_to_cpu(*(usPtr + index));
+ checksum = checksum ^ le16_to_cpu(
+ *(__le16 *)(usPtr + index));
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff&checksum);
}
--
2.0.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16"
2015-04-02 9:37 [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16" Piotr Witoslawski
@ 2015-04-02 10:07 ` Dan Carpenter
2015-04-02 10:17 ` Jes Sorensen
2015-04-02 13:37 ` [PATCH v2] " Piotr Witoslawski
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-04-02 10:07 UTC (permalink / raw)
To: Piotr Witoslawski
Cc: Larry Finger, devel, Jes Sorensen, linux-wireless,
Yannis Damigos, linux-kernel, Greg Kroah-Hartman
This doesn't look right and it doesn't have a changelog explainly the
weirdness.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16"
2015-04-02 10:07 ` Dan Carpenter
@ 2015-04-02 10:17 ` Jes Sorensen
0 siblings, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2015-04-02 10:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Piotr Witoslawski, Larry Finger, devel, linux-wireless,
Yannis Damigos, linux-kernel, Greg Kroah-Hartman
Dan Carpenter <dan.carpenter@oracle.com> writes:
> This doesn't look right and it doesn't have a changelog explainly the
> weirdness.
>
... and the fix is as ugly as it gets!
If something like this is needed, creating a __le16 *ptr at the
beginnging of the function would be a lot better.
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16"
2015-04-02 9:37 [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16" Piotr Witoslawski
2015-04-02 10:07 ` Dan Carpenter
@ 2015-04-02 13:37 ` Piotr Witoslawski
1 sibling, 0 replies; 4+ messages in thread
From: Piotr Witoslawski @ 2015-04-02 13:37 UTC (permalink / raw)
To: Larry Finger
Cc: Jes Sorensen, Greg Kroah-Hartman, Yannis Damigos, linux-wireless,
devel, linux-kernel
This patch fixes the sparse warning: "cast to restricted __le16" reported
for rtl8723au/hal/rtl8723au_xmit.c
Signed-off-by: Piotr Witoslawski <pwitos@gmail.com>
---
v2: Changing pointer type instead of casting, as suggested by Jes Sorensen <jes.sorensen@redhat.com>
drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index 1759487..967e7de 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -42,7 +42,7 @@ static int urb_zero_packet_chk(struct rtw_adapter *padapter, int sz)
static void rtl8192cu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
{
- u16 *usPtr = (u16 *)ptxdesc;
+ __le16 *usPtr = (__le16 *)ptxdesc;
u32 count = 16; /* (32 bytes / 2 bytes per XOR) => 16 times */
u32 index;
u16 checksum = 0;
--
2.0.5
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-02 13:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 9:37 [PATCH] drivers: staging: rtl8723au: fix "warning: cast to restricted __le16" Piotr Witoslawski
2015-04-02 10:07 ` Dan Carpenter
2015-04-02 10:17 ` Jes Sorensen
2015-04-02 13:37 ` [PATCH v2] " Piotr Witoslawski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).