[PATCH] Staging: ozwpan: ozusbsvc1.c: Fix missing blank line after declarations

2015-07-08 Thread Johannes Postma
This patch fixes a missing line after declarations issue.

Signed-off-by: Johannes Postma 
---
 drivers/staging/ozwpan/ozusbsvc1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/ozwpan/ozusbsvc1.c 
b/drivers/staging/ozwpan/ozusbsvc1.c
index 301fee8..b6cfecb 100644
--- a/drivers/staging/ozwpan/ozusbsvc1.c
+++ b/drivers/staging/ozwpan/ozusbsvc1.c
@@ -327,6 +327,7 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx 
*usb_ctx,
(struct oz_multiple_fixed *)data_hdr;
u8 *data = body->data;
unsigned int n;
+
if (!body->unit_size ||
len < sizeof(struct oz_multiple_fixed) - 1)
break;
-- 
2.4.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2015-08-06 Thread Johannes Postma
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 
---
 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

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2015-08-07 Thread Johannes Postma
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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: rtl8723a_hal_init: Improve code readability

2015-08-07 Thread Johannes Postma
This patch improves code readability in the function
rtl8723a_cal_txdesc_chksum.  It improves the readability of the argument
of the function le16_to_cpu.

Signed-off-by: Johannes Postma 
---
 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 eb76ac4..cf2388f 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1847,7 +1847,7 @@ static void rtl8723a_cal_txdesc_chksum(struct tx_desc 
*ptxdesc)
ptxdesc->txdw7 &= cpu_to_le32(0x);
 
for (index = 0; index < count; index++)
-   checksum ^= le16_to_cpu(*(usPtr + index));
+   checksum ^= le16_to_cpu(usPtr[index]);
 
ptxdesc->txdw7 |= cpu_to_le32(checksum & 0x);
 }
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2015-08-07 Thread Johannes Postma
On 07/08/15 at 08:26am, Jes Sorensen wrote:
> Johannes Postma  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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel