LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16
@ 2015-08-06 11:21 Johannes Postma
  2015-08-06 12:21 ` Jes Sorensen
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Postma @ 2015-08-06 11:21 UTC (permalink / raw)
  To: linux-kernel, linux-wireless, devel
  Cc: Johannes Postma, Larry Finger, Jes Sorensen, Greg Kroah-Hartman

usPtr is used as __le16 *, but was defined as u16 *.
This was reported by sparse as:
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1850:29: warning: cast to
restricted __le16

This patch fixes the type of usPtr.

Signed-off-by: Johannes Postma <jgmpostma@gmail.com>
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index cb5076a..eb76ac4 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1838,7 +1838,7 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter,
 
 static void rtl8723a_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.5.0


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH] staging: rtl8723au: Fix sparse warning cast to restricted __le16
@ 2015-03-11 17:21 Marcus Folkesson
  2015-03-11 18:23 ` Jes Sorensen
  0 siblings, 1 reply; 11+ messages in thread
From: Marcus Folkesson @ 2015-03-11 17:21 UTC (permalink / raw)
  To: Larry Finger, Jes Sorensen, Greg Kroah-Hartman, Marcus Folkesson
  Cc: linux-wireless, devel, linux-kernel

This patch fixes the following sparse warnings:

  CHECK   drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:265:37: warning:
  cast to restricted __le16
  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:267:39: warning:
  cast to restricted __le16

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/staging/rtl8723au/include/rtl8723a_hal.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index e146336..f642b11 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -255,10 +255,10 @@ struct hal_data_8723a {
 	struct hal_version		VersionID;
 	enum rt_customer_id CustomerID;
 
-	u16	FirmwareVersion;
-	u16	FirmwareVersionRev;
-	u16	FirmwareSubVersion;
-	u16	FirmwareSignature;
+	__le16	FirmwareVersion;
+	__le16	FirmwareVersionRev;
+	__le16	FirmwareSubVersion;
+	__le16	FirmwareSignature;
 
 	/* current WIFI_PHY values */
 	u32	ReceiveConfig;
-- 
1.9.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH] staging:rtl8723au: Fix sparse warning cast to restricted __le16
@ 2014-11-18  1:45 Tobenna P. Igwe
  2014-11-18  1:59 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Tobenna P. Igwe @ 2014-11-18  1:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: devel, linux-wireless, gregkh, Larry.Finger, Jes.Sorensen

This patch fixes the following sparse warning:

drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c:343:36: warning:
cast to restricted __le16

by using the le16_to_cpus function.

Signed-off-by: Tobenna P. Igwe <ptigwe@gmail.com>
---
 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index d80ea4e..78665ee 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -340,7 +340,7 @@ static u8 bthci_GetAssocInfo(struct rtw_adapter *padapter, u8 EntryNum)
 			tempBuf, TotalLen-BaseMemoryShift);
 
 		pAmpAsoc = (struct amp_assoc_structure *)tempBuf;
-		pAmpAsoc->Length = le16_to_cpu(pAmpAsoc->Length);
+		le16_to_cpus(&pAmpAsoc->Length);
 		BaseMemoryShift += 3 + pAmpAsoc->Length;
 
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("TypeID = 0x%x, ", pAmpAsoc->TypeID));
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-08-07 13:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06 11:21 [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16 Johannes Postma
2015-08-06 12:21 ` Jes Sorensen
2015-08-07  8:37   ` Johannes Postma
2015-08-07 12:26     ` Jes Sorensen
2015-08-07 13:08       ` Johannes Postma
  -- strict thread matches above, loose matches on Subject: below --
2015-03-11 17:21 [PATCH] staging: rtl8723au: Fix sparse warning " Marcus Folkesson
2015-03-11 18:23 ` Jes Sorensen
2014-11-18  1:45 [PATCH] staging:rtl8723au: " Tobenna P. Igwe
2014-11-18  1:59 ` Greg KH
2014-11-18  2:51   ` Tobenna Peter, Igwe
2014-11-18  4:06     ` Greg KH

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).