Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1201661 > unrolled thread

[PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16

Started byJohannes Postma <jgmpostma@gmail.com>
First post2015-08-06 13:30 +0200
Last post2015-08-07 15:10 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16 Johannes Postma <jgmpostma@gmail.com> - 2015-08-06 13:30 +0200
    Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16 Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-08-06 14:30 +0200
      Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to  restricted __le16 Johannes Postma <jgmpostma@gmail.com> - 2015-08-07 10:40 +0200
        Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16 Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-08-07 14:30 +0200
          Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to  restricted __le16 Johannes Postma <jgmpostma@gmail.com> - 2015-08-07 15:10 +0200

#1201661 — [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16

FromJohannes Postma <jgmpostma@gmail.com>
Date2015-08-06 13:30 +0200
Subject[PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16
Message-ID<pUrx0-7uB-13@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1201700

FromJes Sorensen <Jes.Sorensen@redhat.com>
Date2015-08-06 14:30 +0200
Message-ID<pUst4-oN-15@gated-at.bofh.it>
In reply to#1201661
Johannes Postma <jgmpostma@gmail.com> writes:
> 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(-)

Looks OK to me. Probably worth changing the *(usPtr + index) to be
usPtr[index] as well to make the code easier to read.

Jes

> 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202449 — Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16

FromJohannes Postma <jgmpostma@gmail.com>
Date2015-08-07 10:40 +0200
SubjectRe: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16
Message-ID<pULm2-2zq-27@gated-at.bofh.it>
In reply to#1201700
On 06/08/15 at 08:21am, Jes Sorensen wrote:
> 
> Looks OK to me. Probably worth changing the *(usPtr + index) to be
> usPtr[index] as well to make the code easier to read.
> 
> Jes
> 

Thank you for reviewing.  I will make a seperate patch for that.  I will
send it after this one is accepted.  Or should I combine them into a
patch serie?

	Johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202644

FromJes Sorensen <Jes.Sorensen@redhat.com>
Date2015-08-07 14:30 +0200
Message-ID<pUOWC-7Ms-15@gated-at.bofh.it>
In reply to#1202449
Johannes Postma <jgmpostma@gmail.com> writes:
> On 06/08/15 at 08:21am, Jes Sorensen wrote:
>> 
>> Looks OK to me. Probably worth changing the *(usPtr + index) to be
>> usPtr[index] as well to make the code easier to read.
>> 
>> Jes
>> 
>
> Thank you for reviewing.  I will make a seperate patch for that.  I will
> send it after this one is accepted.  Or should I combine them into a
> patch serie?

Either is fine with me.

Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202663 — Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16

FromJohannes Postma <jgmpostma@gmail.com>
Date2015-08-07 15:10 +0200
SubjectRe: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16
Message-ID<pUPzj-lu-7@gated-at.bofh.it>
In reply to#1202644
On 07/08/15 at 08:26am, Jes Sorensen wrote:
> Johannes Postma <jgmpostma@gmail.com> writes:
> > On 06/08/15 at 08:21am, Jes Sorensen wrote:
> >> 
> >> Looks OK to me. Probably worth changing the *(usPtr + index) to be
> >> usPtr[index] as well to make the code easier to read.
> >> 
> >> Jes
> >> 
> >
> > Thank you for reviewing.  I will make a seperate patch for that.  I will
> > send it after this one is accepted.  Or should I combine them into a
> > patch serie?
> 
> Either is fine with me.
> 
> Jes

Ok, I have sent it as a separate patch.  Since it doesn't depend on this
patch and should apply cleanly I have already sent it in.

	Johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web