linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
@ 2017-04-26 16:15 Karim Eshapa
  2017-04-28 10:02 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Karim Eshapa @ 2017-04-26 16:15 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Karim Eshapa

Fixing sparse warnings incorrect type assignment.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6134eba..cf6bf65 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3511,20 +3511,24 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 		datap = skb_put(skb, sizeof(struct p80211_caphdr));
 		caphdr = (struct p80211_caphdr *)datap;
 
-		caphdr->version = htonl(P80211CAPTURE_VERSION);
-		caphdr->length = htonl(sizeof(struct p80211_caphdr));
+		caphdr->version = __be32_to_cpu(htonl(P80211CAPTURE_VERSION));
+		caphdr->length = __be32_to_cpu( htonl(sizeof(
+						struct p80211_caphdr)));
 		caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000;
 		caphdr->hosttime = __cpu_to_be64(jiffies);
-		caphdr->phytype = htonl(4);	/* dss_dot11_b */
-		caphdr->channel = htonl(hw->sniff_channel);
-		caphdr->datarate = htonl(rxdesc->rate);
-		caphdr->antenna = htonl(0);	/* unknown */
-		caphdr->priority = htonl(0);	/* unknown */
-		caphdr->ssi_type = htonl(3);	/* rssi_raw */
+
+		/* dss_dot11_b */
+		caphdr->phytype = __be32_to_cpu(htonl(4));
+
+		caphdr->channel = __be32_to_cpu(htonl(hw->sniff_channel));
+		caphdr->datarate = __be32_to_cpu(htonl(rxdesc->rate));
+		caphdr->antenna =  __be32_to_cpu(htonl(0));	/* unknown */
+		caphdr->priority = __be32_to_cpu(htonl(0));	/* unknown */
+		caphdr->ssi_type = __be32_to_cpu(htonl(3));	/* rssi_raw */
 		caphdr->ssi_signal = htonl(rxdesc->signal);
 		caphdr->ssi_noise = htonl(rxdesc->silence);
-		caphdr->preamble = htonl(0);	/* unknown */
-		caphdr->encoding = htonl(1);	/* cck */
+		caphdr->preamble = __be32_to_cpu(htonl(0));	/* unknown */
+		caphdr->encoding = __be32_to_cpu(htonl(1));	/* cck */
 	}
 
 	/* Copy the 802.11 header to the skb
-- 
2.7.4

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

* Re: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-04-26 16:15 [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings Karim Eshapa
@ 2017-04-28 10:02 ` Greg KH
  2017-04-30 16:26 ` Karim Eshapa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-04-28 10:02 UTC (permalink / raw)
  To: Karim Eshapa; +Cc: linux-kernel

On Wed, Apr 26, 2017 at 06:15:40PM +0200, Karim Eshapa wrote:
> Fixing sparse warnings incorrect type assignment.
> 
> Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
> ---
>  drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index 6134eba..cf6bf65 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -3511,20 +3511,24 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
>  		datap = skb_put(skb, sizeof(struct p80211_caphdr));
>  		caphdr = (struct p80211_caphdr *)datap;
>  
> -		caphdr->version = htonl(P80211CAPTURE_VERSION);
> -		caphdr->length = htonl(sizeof(struct p80211_caphdr));
> +		caphdr->version = __be32_to_cpu(htonl(P80211CAPTURE_VERSION));
> +		caphdr->length = __be32_to_cpu( htonl(sizeof(
> +						struct p80211_caphdr)));

How do you know this is correct?  And why the odd ' ' usage?  I can't
take this patch for that reason alone...

thanks,

greg k-h

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

* RE:[PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-04-26 16:15 [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings Karim Eshapa
  2017-04-28 10:02 ` Greg KH
@ 2017-04-30 16:26 ` Karim Eshapa
  2017-05-07 18:39   ` [PATCH] " Arnd Bergmann
  2017-05-10 13:15 ` Karim Eshapa
  2017-05-12 12:47 ` Karim Eshapa
  3 siblings, 1 reply; 7+ messages in thread
From: Karim Eshapa @ 2017-04-30 16:26 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Karim Eshapa

On Fri, 28 Apr 2017 12:02:58 +0200, Greg KH wrote:
> On Wed, Apr 26, 2017 at 06:15:40PM +0200, Karim Eshapa wrote:
>
>> Fixing sparse warnings incorrect type assignment.
>>
>> Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
>> ---
>>  drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++++----------
>>  1 file changed, 14 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
>> index 6134eba..cf6bf65 100644
>> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
>> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
>> @@ -3511,20 +3511,24 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
>>               datap = skb_put(skb, sizeof(struct p80211_caphdr));
>>               caphdr = (struct p80211_caphdr *)datap;
>>
>> -             caphdr->version = htonl(P80211CAPTURE_VERSION);
>> -             caphdr->length = htonl(sizeof(struct p80211_caphdr));
>> +             caphdr->version = __be32_to_cpu(htonl(P80211CAPTURE_VERSION));
>> +             caphdr->length = __be32_to_cpu( htonl(sizeof(
>> +                                             struct p80211_caphdr)));
>>

> How do you know this is correct?  And why the odd ' ' usage?  I can't
> take this patch for that reason alone...
>

Actually using __be32_to_cpu may result in a problem if it's built for le machine.
becasue if the network byte order needs to be represented in __be32 such that the 
header is going through the network in a right order.
So, I suggest if we can change the structure's args type into __be32 that I don't 
trust it if it can force the arg to be big endian as it's defined as  __attribute__((bitwise))
that I'm not sure if it's GNU C attribute. 
that I didn't want from the beginning.

Thanks,
Karim  

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

* Re: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-04-30 16:26 ` Karim Eshapa
@ 2017-05-07 18:39   ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2017-05-07 18:39 UTC (permalink / raw)
  To: Karim Eshapa; +Cc: gregkh, Linux Kernel Mailing List

On Sun, Apr 30, 2017 at 6:26 PM, Karim Eshapa <karim.eshapa@gmail.com> wrote:
> On Fri, 28 Apr 2017 12:02:58 +0200, Greg KH wrote:
>> On Wed, Apr 26, 2017 at 06:15:40PM +0200, Karim Eshapa wrote:
>>
>>> Fixing sparse warnings incorrect type assignment.
>>>
>>> Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
>>> ---
>>>  drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++++----------
>>>  1 file changed, 14 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
>>> index 6134eba..cf6bf65 100644
>>> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
>>> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
>>> @@ -3511,20 +3511,24 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
>>>               datap = skb_put(skb, sizeof(struct p80211_caphdr));
>>>               caphdr = (struct p80211_caphdr *)datap;
>>>
>>> -             caphdr->version = htonl(P80211CAPTURE_VERSION);
>>> -             caphdr->length = htonl(sizeof(struct p80211_caphdr));
>>> +             caphdr->version = __be32_to_cpu(htonl(P80211CAPTURE_VERSION));
>>> +             caphdr->length = __be32_to_cpu( htonl(sizeof(
>>> +                                             struct p80211_caphdr)));
>>>
>
>> How do you know this is correct?  And why the odd ' ' usage?  I can't
>> take this patch for that reason alone...
>>
>
> Actually using __be32_to_cpu may result in a problem if it's built for le machine.
> becasue if the network byte order needs to be represented in __be32 such that the
> header is going through the network in a right order.
> So, I suggest if we can change the structure's args type into __be32 that I don't
> trust it if it can force the arg to be big endian as it's defined as  __attribute__((bitwise))
> that I'm not sure if it's GNU C attribute.
> that I didn't want from the beginning.

It sounds like the correct fix would be to change the type of the members
in p80211_caphdr.

       Arnd

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

* RE: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-04-26 16:15 [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings Karim Eshapa
  2017-04-28 10:02 ` Greg KH
  2017-04-30 16:26 ` Karim Eshapa
@ 2017-05-10 13:15 ` Karim Eshapa
  2017-05-12  8:07   ` Greg KH
  2017-05-12 12:47 ` Karim Eshapa
  3 siblings, 1 reply; 7+ messages in thread
From: Karim Eshapa @ 2017-05-10 13:15 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Karim Eshapa

Change the types of capture header, finally we need the header
to be represented in the network byte order as __be..
this is a piece of doc that he mentioned it in the code doc/capturefrm.txt
You can check
https://github.com/jdkoftinoff/mb-linux-msli/blob/master/
uClinux-dist/user/wlan-ng/doc/capturefrm.txt

3. Byte Order
All multibyte fields of the capture header are in "network" byte
order.  The "host to network" and "network to host" functions should
work just fine.  All the remaining multibyte fields are ordered
according to their respective standards.

4. Capture Header Format
The following fields make up the AVS capture header:

	Offset	Name		Type
	------------------------------
	0	version		uint32
	4	length		uint32
	8	mactime		uint64
	16	hosttime	uint64
	24	phytype		uint32
	28	channel		uint32
	32	datarate	uint32
	36	antenna		uint32
	40	priority	uint32
	44	ssi_type	uint32
	48	ssi_signal	int32
	52	ssi_noise	int32
	56	preamble	uint32
	60	encoding	uint32
------------------------------

and the warnings here fixed

drivers/staging/wlan-ng/hfa384x_usb.c:3514:33: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    expected unsigned int [unsigned] [usertype] version
drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3515:32: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    expected unsigned int [unsigned] [usertype] length
drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3516:35: warning: restricted __be64 degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3517:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    expected unsigned long long [unsigned] [usertype] hosttime
drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    got restricted __be64 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3518:33: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    expected unsigned int [unsigned] [usertype] phytype
drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3519:33: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    expected unsigned int [unsigned] [usertype] channel
drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3520:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    expected unsigned int [unsigned] [usertype] datarate
drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3521:33: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    expected unsigned int [unsigned] [usertype] antenna
drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3522:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    expected unsigned int [unsigned] [usertype] priority
drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3523:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    expected unsigned int [unsigned] [usertype] ssi_type
drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3524:36: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    expected signed int [signed] [usertype] [explicitly-signed] ssi_signal
drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3525:35: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    expected signed int [signed] [usertype] [explicitly-signed] ssi_noise
drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3526:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    expected unsigned int [unsigned] [usertype] preamble
drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    got restricted __be32 [usertype] <noident>
drivers/staging/wlan-ng/hfa384x_usb.c:3527:34: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    expected unsigned int [unsigned] [usertype] encoding
drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    got restricted __be32 [usertype] <noident>

If this patch is fine, can I send the rest of fixes.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c |  2 +-
 drivers/staging/wlan-ng/p80211conv.h  | 28 ++++++++++++++--------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6134eba..8f989bc 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3513,7 +3513,7 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 
 		caphdr->version = htonl(P80211CAPTURE_VERSION);
 		caphdr->length = htonl(sizeof(struct p80211_caphdr));
-		caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000;
+		caphdr->mactime = __cpu_to_be64(rxdesc->time * 1000);
 		caphdr->hosttime = __cpu_to_be64(jiffies);
 		caphdr->phytype = htonl(4);	/* dss_dot11_b */
 		caphdr->channel = htonl(hw->sniff_channel);
diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h
index 04bac2e..66332b1 100644
--- a/drivers/staging/wlan-ng/p80211conv.h
+++ b/drivers/staging/wlan-ng/p80211conv.h
@@ -101,20 +101,20 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb);
  * Frame capture header.  (See doc/capturefrm.txt)
  */
 struct p80211_caphdr {
-	u32 version;
-	u32 length;
-	u64 mactime;
-	u64 hosttime;
-	u32 phytype;
-	u32 channel;
-	u32 datarate;
-	u32 antenna;
-	u32 priority;
-	u32 ssi_type;
-	s32 ssi_signal;
-	s32 ssi_noise;
-	u32 preamble;
-	u32 encoding;
+	__be32 version;
+	__be32 length;
+	__be64 mactime;
+	__be64 hosttime;
+	__be32 phytype;
+	__be32 channel;
+	__be32 datarate;
+	__be32 antenna;
+	__be32 priority;
+	__be32 ssi_type;
+	__be32 ssi_signal;
+	__be32 ssi_noise;
+	__be32 preamble;
+	__be32 encoding;
 };
 
 /* buffer free method pointer type */
-- 
2.7.4

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

* Re: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-05-10 13:15 ` Karim Eshapa
@ 2017-05-12  8:07   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-05-12  8:07 UTC (permalink / raw)
  To: Karim Eshapa; +Cc: linux-kernel

First off, why the "Re:" in the subject?

Second, your subject sucks :)

Try making it a bit more descriptive as to what you are doing, "fixing
sparse warnings" is very vague.

On Wed, May 10, 2017 at 03:15:38PM +0200, Karim Eshapa wrote:
> Change the types of capture header, finally we need the header
> to be represented in the network byte order as __be..
> this is a piece of doc that he mentioned it in the code doc/capturefrm.txt
> You can check
> https://github.com/jdkoftinoff/mb-linux-msli/blob/master/
> uClinux-dist/user/wlan-ng/doc/capturefrm.txt
> 
> 3. Byte Order

3?  Where is 1. and 2.?

> All multibyte fields of the capture header are in "network" byte
> order.  The "host to network" and "network to host" functions should
> work just fine.  All the remaining multibyte fields are ordered
> according to their respective standards.
> 
> 4. Capture Header Format
> The following fields make up the AVS capture header:
> 
> 	Offset	Name		Type
> 	------------------------------
> 	0	version		uint32
> 	4	length		uint32
> 	8	mactime		uint64
> 	16	hosttime	uint64
> 	24	phytype		uint32
> 	28	channel		uint32
> 	32	datarate	uint32
> 	36	antenna		uint32
> 	40	priority	uint32
> 	44	ssi_type	uint32
> 	48	ssi_signal	int32
> 	52	ssi_noise	int32
> 	56	preamble	uint32
> 	60	encoding	uint32
> ------------------------------
> 
> and the warnings here fixed
> 
> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    expected unsigned int [unsigned] [usertype] version
> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    expected unsigned int [unsigned] [usertype] length
> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3516:35: warning: restricted __be64 degrades to integer
> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    expected unsigned long long [unsigned] [usertype] hosttime
> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    got restricted __be64 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    expected unsigned int [unsigned] [usertype] phytype
> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    expected unsigned int [unsigned] [usertype] channel
> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    expected unsigned int [unsigned] [usertype] datarate
> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    expected unsigned int [unsigned] [usertype] antenna
> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    expected unsigned int [unsigned] [usertype] priority
> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    expected unsigned int [unsigned] [usertype] ssi_type
> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    expected signed int [signed] [usertype] [explicitly-signed] ssi_signal
> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    expected signed int [signed] [usertype] [explicitly-signed] ssi_noise
> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    expected unsigned int [unsigned] [usertype] preamble
> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    got restricted __be32 [usertype] <noident>
> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    expected unsigned int [unsigned] [usertype] encoding
> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    got restricted __be32 [usertype] <noident>
> 
> If this patch is fine, can I send the rest of fixes.

This line doesn't need to be in a changelog text, right?  Please fix up
and resend.

thanks,

greg k-h

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

* RE: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.
  2017-04-26 16:15 [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings Karim Eshapa
                   ` (2 preceding siblings ...)
  2017-05-10 13:15 ` Karim Eshapa
@ 2017-05-12 12:47 ` Karim Eshapa
  3 siblings, 0 replies; 7+ messages in thread
From: Karim Eshapa @ 2017-05-12 12:47 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Karim Eshapa

On Fri, 12 May 2017 10:07:14 +0200 Greg KH wrote:
>First off, why the "Re:" in the subject?
>
>Second, your subject sucks :)
>
>Try making it a bit more descriptive as to what you are doing, "fixing
>sparse warnings" is very vague.
>
>On Wed, May 10, 2017 at 03:15:38PM +0200, Karim Eshapa wrote:
>
>> Change the types of capture header, finally we need the header
>> to be represented in the network byte order as __be..
>> this is a piece of doc that he mentioned it in the code doc/capturefrm.txt
>> You can check
>> https://github.com/jdkoftinoff/mb-linux-msli/blob/master/
>> uClinux-dist/user/wlan-ng/doc/capturefrm.txt
>>
>> 3. Byte Order
>>
>
>3?  Where is 1. and 2.?
>

This line is part of documentation mentioned in 
the main code doc/capturefrm.txt. 1., 2. exist
in the documentation.

>> All multibyte fields of the capture header are in "network" byte
>> order.  The "host to network" and "network to host" functions should
>> work just fine.  All the remaining multibyte fields are ordered
>> according to their respective standards.
>>
>> 4. Capture Header Format
>> The following fields make up the AVS capture header:
>>
>>       Offset  Name            Type
>>       ------------------------------
>>       0       version         uint32
>>       4       length          uint32
>>       8       mactime         uint64
>>       16      hosttime        uint64
>>       24      phytype         uint32
>>       28      channel         uint32
>>      32      datarate        uint32
>>       36      antenna         uint32
>>       40      priority        uint32
>>       44      ssi_type        uint32
>>       48      ssi_signal      int32
>>       52      ssi_noise       int32
>>       56      preamble        uint32
>>       60      encoding        uint32
>> ------------------------------
>>
>> and the warnings here fixed
>>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    expected unsigned int [unsigned] [usertype] version
>> drivers/staging/wlan-ng/hfa384x_usb.c:3514:33:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    expected unsigned int [unsigned] [usertype] length
>> drivers/staging/wlan-ng/hfa384x_usb.c:3515:32:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3516:35: warning: restricted __be64 degrades to integer
>> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    expected unsigned long long [unsigned] [usertype] hosttime
>> drivers/staging/wlan-ng/hfa384x_usb.c:3517:34:    got restricted __be64 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    expected unsigned int [unsigned] [usertype] phytype
>> drivers/staging/wlan-ng/hfa384x_usb.c:3518:33:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    expected unsigned int [unsigned] [usertype] channel
>> drivers/staging/wlan-ng/hfa384x_usb.c:3519:33:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    expected unsigned int [unsigned] [usertype] datarate
>> drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    expected unsigned int [unsigned] [usertype] antenna
>> drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    expected unsigned int [unsigned] [usertype] priority
>> drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    expected unsigned int [unsigned] [usertype] ssi_type
>> drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    expected signed int [signed] [usertype] [explicitly-signed] ssi_signal
>> drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    expected signed int [signed] [usertype] [explicitly-signed] ssi_noise
>> drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    expected unsigned int [unsigned] [usertype] preamble
>> drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:    got restricted __be32 [usertype] <noident>
>> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34: warning: incorrect type in assignment (different base types)
>> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    expected unsigned int [unsigned] [usertype] encoding
>> drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:    got restricted __be32 [usertype] <noident>
>>
>> If this patch is fine, can I send the rest of fixes.
>>
>
>This line doesn't need to be in a changelog text, right?  Please fix up
>and resend.
>

Ok sorry I'm gonna send you the new patch
with descriptive subject.

Thanks,
Karim

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

end of thread, other threads:[~2017-05-12 12:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 16:15 [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings Karim Eshapa
2017-04-28 10:02 ` Greg KH
2017-04-30 16:26 ` Karim Eshapa
2017-05-07 18:39   ` [PATCH] " Arnd Bergmann
2017-05-10 13:15 ` Karim Eshapa
2017-05-12  8:07   ` Greg KH
2017-05-12 12:47 ` Karim Eshapa

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