Re: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings.

From: Greg KH
Date: Fri Apr 28 2017 - 06:03:31 EST


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@xxxxxxxxx>
> ---
> 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