diff mbox

staging: rtl8723au: Fix sparse warning cast to restricted __le16

Message ID 1426094490-17065-1-git-send-email-marcus.folkesson@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Marcus Folkesson March 11, 2015, 5:21 p.m. UTC
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(-)

Comments

Jes Sorensen March 11, 2015, 6:23 p.m. UTC | #1
Marcus Folkesson <marcus.folkesson@gmail.com> writes:
> 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;

Ehm I am pretty sure it doesn't:

rtl8723au_hal_init.c:265
        pHalData->FirmwareVersion = le16_to_cpu(pFwHdr->Version);
	pHalData->FirmwareSubVersion = pFwHdr->Subversion;
	pHalData->FirmwareSignature = le16_to_cpu(pFwHdr->Signature);

If anything, the second assignment there should be changed to use
le16_to_cpu(), but your conversion is definitely wrong.

NACK

Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;