linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: wlan-ng: Amend type mismatch warnings
@ 2017-06-12 17:15 sunil.m
  2017-06-12 18:48 ` Frans Klaver
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: sunil.m @ 2017-06-12 17:15 UTC (permalink / raw)
  To: gregkh
  Cc: sergio.paracuellos, geo.emmnl, sfaragnaus, karniksayli1995,
	fransklaver, devel, linux-kernel, Suniel Mahesh

From: Suniel Mahesh <sunil.m@techveda.org>

The following type mismatch warnings reported by sparse
have been amended:
warning: cast to restricted __le16
warning: incorrect type in assignment (different base types)

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
---
 drivers/staging/wlan-ng/prism2mgmt.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index f4d6e48..358b556 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -185,7 +185,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
 
 	/* set up the txrate to be 2MBPS. Should be fastest basicrate... */
 	word = HFA384x_RATEBIT_2;
-	scanreq.tx_rate = cpu_to_le16(word);
+	scanreq.tx_rate = (__force u16)cpu_to_le16(word);
 
 	/* set up the channel list */
 	word = 0;
@@ -197,10 +197,10 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
 		/* channel 1 is BIT 0 ... channel 14 is BIT 13 */
 		word |= (1 << (channel - 1));
 	}
-	scanreq.channel_list = cpu_to_le16(word);
+	scanreq.channel_list = (__force u16)cpu_to_le16(word);
 
 	/* set up the ssid, if present. */
-	scanreq.ssid.len = cpu_to_le16(msg->ssid.data.len);
+	scanreq.ssid.len = (__force u16)cpu_to_le16(msg->ssid.data.len);
 	memcpy(scanreq.ssid.data, msg->ssid.data.data, msg->ssid.data.len);
 
 	/* Enable the MAC port if it's not already enabled  */
@@ -229,7 +229,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
 		/* Construct a bogus SSID and assign it to OwnSSID and
 		 * DesiredSSID
 		 */
-		wordbuf[0] = cpu_to_le16(WLAN_SSID_MAXLEN);
+		wordbuf[0] = (__force u16)cpu_to_le16(WLAN_SSID_MAXLEN);
 		get_random_bytes(&wordbuf[1], WLAN_SSID_MAXLEN);
 		result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
 						wordbuf,
@@ -405,8 +405,8 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 	/* signal and noise */
 	req->signal.status = P80211ENUM_msgitem_status_data_ok;
 	req->noise.status = P80211ENUM_msgitem_status_data_ok;
-	req->signal.data = le16_to_cpu(item->sl);
-	req->noise.data = le16_to_cpu(item->anl);
+	req->signal.data = le16_to_cpu((__force __le16)item->sl);
+	req->noise.data = le16_to_cpu((__force __le16)item->anl);
 
 	/* BSSID */
 	req->bssid.status = P80211ENUM_msgitem_status_data_ok;
@@ -415,7 +415,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 	/* SSID */
 	req->ssid.status = P80211ENUM_msgitem_status_data_ok;
-	req->ssid.data.len = le16_to_cpu(item->ssid.len);
+	req->ssid.data.len = le16_to_cpu((__force __le16)item->ssid.len);
 	req->ssid.data.len = min_t(u16, req->ssid.data.len, WLAN_SSID_MAXLEN);
 	memcpy(req->ssid.data.data, item->ssid.data, req->ssid.data.len);
 
@@ -463,7 +463,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 	/* beacon period */
 	req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok;
-	req->beaconperiod.data = le16_to_cpu(item->bcnint);
+	req->beaconperiod.data = le16_to_cpu((__force __le16)item->bcnint);
 
 	/* timestamps */
 	req->timestamp.status = P80211ENUM_msgitem_status_data_ok;
@@ -473,14 +473,14 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 	/* atim window */
 	req->ibssatimwindow.status = P80211ENUM_msgitem_status_data_ok;
-	req->ibssatimwindow.data = le16_to_cpu(item->atim);
+	req->ibssatimwindow.data = le16_to_cpu((__force __le16)item->atim);
 
 	/* Channel */
 	req->dschannel.status = P80211ENUM_msgitem_status_data_ok;
-	req->dschannel.data = le16_to_cpu(item->chid);
+	req->dschannel.data = le16_to_cpu((__force __le16)item->chid);
 
 	/* capinfo bits */
-	count = le16_to_cpu(item->capinfo);
+	count = le16_to_cpu((__force __le16)item->capinfo);
 	req->capinfo.status = P80211ENUM_msgitem_status_data_ok;
 	req->capinfo.data = count;
 
-- 
1.9.1

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

* Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings
  2017-06-12 17:15 [PATCH] staging: wlan-ng: Amend type mismatch warnings sunil.m
@ 2017-06-12 18:48 ` Frans Klaver
  2017-06-12 20:10 ` Dan Carpenter
  2017-06-13  9:23 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Frans Klaver @ 2017-06-12 18:48 UTC (permalink / raw)
  To: sunil.m
  Cc: Greg KH, sergio.paracuellos, geo.emmnl, sfaragnaus,
	karniksayli1995, devel, linux-kernel

On Mon, Jun 12, 2017 at 7:15 PM,  <sunil.m@techveda.org> wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
>
> The following type mismatch warnings reported by sparse
> have been amended:
> warning: cast to restricted __le16
> warning: incorrect type in assignment (different base types)

Why not change the type of the struct fields to __le16 where they
would need to be __le16 (thereby documenting the requirement)? This is
just telling the compiler to shut up, not necessarily fixing the issue
that it's flagging.

Cheers,
Frans


>
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index f4d6e48..358b556 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -185,7 +185,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>
>         /* set up the txrate to be 2MBPS. Should be fastest basicrate... */
>         word = HFA384x_RATEBIT_2;
> -       scanreq.tx_rate = cpu_to_le16(word);
> +       scanreq.tx_rate = (__force u16)cpu_to_le16(word);
>
>         /* set up the channel list */
>         word = 0;
> @@ -197,10 +197,10 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>                 /* channel 1 is BIT 0 ... channel 14 is BIT 13 */
>                 word |= (1 << (channel - 1));
>         }
> -       scanreq.channel_list = cpu_to_le16(word);
> +       scanreq.channel_list = (__force u16)cpu_to_le16(word);
>
>         /* set up the ssid, if present. */
> -       scanreq.ssid.len = cpu_to_le16(msg->ssid.data.len);
> +       scanreq.ssid.len = (__force u16)cpu_to_le16(msg->ssid.data.len);
>         memcpy(scanreq.ssid.data, msg->ssid.data.data, msg->ssid.data.len);
>
>         /* Enable the MAC port if it's not already enabled  */
> @@ -229,7 +229,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>                 /* Construct a bogus SSID and assign it to OwnSSID and
>                  * DesiredSSID
>                  */
> -               wordbuf[0] = cpu_to_le16(WLAN_SSID_MAXLEN);
> +               wordbuf[0] = (__force u16)cpu_to_le16(WLAN_SSID_MAXLEN);
>                 get_random_bytes(&wordbuf[1], WLAN_SSID_MAXLEN);
>                 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
>                                                 wordbuf,
> @@ -405,8 +405,8 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
>         /* signal and noise */
>         req->signal.status = P80211ENUM_msgitem_status_data_ok;
>         req->noise.status = P80211ENUM_msgitem_status_data_ok;
> -       req->signal.data = le16_to_cpu(item->sl);
> -       req->noise.data = le16_to_cpu(item->anl);
> +       req->signal.data = le16_to_cpu((__force __le16)item->sl);
> +       req->noise.data = le16_to_cpu((__force __le16)item->anl);
>
>         /* BSSID */
>         req->bssid.status = P80211ENUM_msgitem_status_data_ok;
> @@ -415,7 +415,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
>
>         /* SSID */
>         req->ssid.status = P80211ENUM_msgitem_status_data_ok;
> -       req->ssid.data.len = le16_to_cpu(item->ssid.len);
> +       req->ssid.data.len = le16_to_cpu((__force __le16)item->ssid.len);
>         req->ssid.data.len = min_t(u16, req->ssid.data.len, WLAN_SSID_MAXLEN);
>         memcpy(req->ssid.data.data, item->ssid.data, req->ssid.data.len);
>
> @@ -463,7 +463,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
>
>         /* beacon period */
>         req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok;
> -       req->beaconperiod.data = le16_to_cpu(item->bcnint);
> +       req->beaconperiod.data = le16_to_cpu((__force __le16)item->bcnint);
>
>         /* timestamps */
>         req->timestamp.status = P80211ENUM_msgitem_status_data_ok;
> @@ -473,14 +473,14 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
>
>         /* atim window */
>         req->ibssatimwindow.status = P80211ENUM_msgitem_status_data_ok;
> -       req->ibssatimwindow.data = le16_to_cpu(item->atim);
> +       req->ibssatimwindow.data = le16_to_cpu((__force __le16)item->atim);
>
>         /* Channel */
>         req->dschannel.status = P80211ENUM_msgitem_status_data_ok;
> -       req->dschannel.data = le16_to_cpu(item->chid);
> +       req->dschannel.data = le16_to_cpu((__force __le16)item->chid);
>
>         /* capinfo bits */
> -       count = le16_to_cpu(item->capinfo);
> +       count = le16_to_cpu((__force __le16)item->capinfo);
>         req->capinfo.status = P80211ENUM_msgitem_status_data_ok;
>         req->capinfo.data = count;
>
> --
> 1.9.1
>

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

* Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings
  2017-06-12 17:15 [PATCH] staging: wlan-ng: Amend type mismatch warnings sunil.m
  2017-06-12 18:48 ` Frans Klaver
@ 2017-06-12 20:10 ` Dan Carpenter
  2017-06-13  9:23 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2017-06-12 20:10 UTC (permalink / raw)
  To: sunil.m
  Cc: gregkh, devel, geo.emmnl, karniksayli1995, linux-kernel,
	sergio.paracuellos, sfaragnaus, fransklaver

No, sorry.  This doesn't look right at all.

regards,
dan carpenter

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

* Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings
  2017-06-12 17:15 [PATCH] staging: wlan-ng: Amend type mismatch warnings sunil.m
  2017-06-12 18:48 ` Frans Klaver
  2017-06-12 20:10 ` Dan Carpenter
@ 2017-06-13  9:23 ` Greg KH
  2017-06-15  6:41   ` [PATCH v2] " sunil.m
  2 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2017-06-13  9:23 UTC (permalink / raw)
  To: sunil.m
  Cc: devel, geo.emmnl, karniksayli1995, linux-kernel,
	sergio.paracuellos, sfaragnaus, fransklaver

On Mon, Jun 12, 2017 at 10:45:38PM +0530, sunil.m@techveda.org wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
> 
> The following type mismatch warnings reported by sparse
> have been amended:
> warning: cast to restricted __le16
> warning: incorrect type in assignment (different base types)
> 
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index f4d6e48..358b556 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -185,7 +185,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>  
>  	/* set up the txrate to be 2MBPS. Should be fastest basicrate... */
>  	word = HFA384x_RATEBIT_2;
> -	scanreq.tx_rate = cpu_to_le16(word);
> +	scanreq.tx_rate = (__force u16)cpu_to_le16(word);

If you ever find yourself using __force, it is almost always the wrong
solution.  Please step back and understand what is going on here before
making a change like this.

good luck!

greg k-h

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

* [PATCH v2] staging: wlan-ng: Amend type mismatch warnings
  2017-06-13  9:23 ` Greg KH
@ 2017-06-15  6:41   ` sunil.m
  2017-06-15 10:03     ` Frans Klaver
  0 siblings, 1 reply; 7+ messages in thread
From: sunil.m @ 2017-06-15  6:41 UTC (permalink / raw)
  To: gregkh
  Cc: sergio.paracuellos, geo.emmnl, sfaragnaus, karniksayli1995,
	fransklaver, devel, linux-kernel, Suniel Mahesh

From: Suniel Mahesh <sunil.m@techveda.org>

le16_to_cpu() accepts argument of type __le16 and cpu_to_le16()
returns an argument of type __le16. This patch fixes warnings
related to incorrect type in assignment and changes the types
in the corresponding header file.
The following type mismatch warnings reported by sparse
have been amended:
warning: cast to restricted __le16
warning: incorrect type in assignment (different base types)

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
---
Changes for v2:
- Reworked on the patch and modified commit message as per the
  recommendations from Frans Klaver and Greg K-H.

- Patch was tested and built on next-20170609 and staging-testing.
---
 drivers/staging/wlan-ng/hfa384x.h    | 18 +++++++++---------
 drivers/staging/wlan-ng/prism2mgmt.c |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
index 310e2c4..f99cc04 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -358,7 +358,7 @@ struct hfa384x_bytestr {
 } __packed;
 
 struct hfa384x_bytestr32 {
-	u16 len;
+	__le16 len;
 	u8 data[32];
 } __packed;
 
@@ -399,8 +399,8 @@ struct hfa384x_caplevel {
 
 /*-- Configuration Record: HostScanRequest (data portion only) --*/
 struct hfa384x_host_scan_request_data {
-	u16 channel_list;
-	u16 tx_rate;
+	__le16 channel_list;
+	__le16 tx_rate;
 	struct hfa384x_bytestr32 ssid;
 } __packed;
 
@@ -682,16 +682,16 @@ struct hfa384x_ch_info_result {
 
 /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
 struct hfa384x_hscan_result_sub {
-	u16 chid;
-	u16 anl;
-	u16 sl;
+	__le16 chid;
+	__le16 anl;
+	__le16 sl;
 	u8 bssid[WLAN_BSSID_LEN];
-	u16 bcnint;
-	u16 capinfo;
+	__le16 bcnint;
+	__le16 capinfo;
 	struct hfa384x_bytestr32 ssid;
 	u8 supprates[10];	/* 802.11 info element */
 	u16 proberesp_rate;
-	u16 atim;
+	__le16 atim;
 } __packed;
 
 struct hfa384x_hscan_result {
diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index f4d6e48..c4aa9e7 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -213,7 +213,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
 		goto exit;
 	}
 	if (word == HFA384x_PORTSTATUS_DISABLED) {
-		u16 wordbuf[17];
+		__le16 wordbuf[17];
 
 		result = hfa384x_drvr_setconfig16(hw,
 					HFA384x_RID_CNFROAMINGMODE,
-- 
1.9.1

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

* Re: [PATCH v2] staging: wlan-ng: Amend type mismatch warnings
  2017-06-15  6:41   ` [PATCH v2] " sunil.m
@ 2017-06-15 10:03     ` Frans Klaver
  2017-06-16  5:31       ` [PATCH v3] staging: wlan-ng: Fix struct definition's and variable type sunil.m
  0 siblings, 1 reply; 7+ messages in thread
From: Frans Klaver @ 2017-06-15 10:03 UTC (permalink / raw)
  To: sunil.m
  Cc: Greg KH, sergio.paracuellos, George Emmanouil,
	Andrea della Porta, sayli karnik, devel, linux-kernel

> Subject: [PATCH v2] staging: wlan-ng: Amend type mismatch warnings

I think it would be better to state that you fix the types of some
struct fields. That's a much more important goal of this patch than
getting sparse to spout slightly fewer warnings.

On Thu, Jun 15, 2017 at 8:41 AM,  <sunil.m@techveda.org> wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
>
> le16_to_cpu() accepts argument of type __le16 and cpu_to_le16()
> returns an argument of type __le16. This patch fixes warnings
> related to incorrect type in assignment and changes the types
> in the corresponding header file.
> The following type mismatch warnings reported by sparse
> have been amended:

You didn't amend them; you removed them.

> warning: cast to restricted __le16
> warning: incorrect type in assignment (different base types)
>
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> ---
> Changes for v2:
> - Reworked on the patch and modified commit message as per the
>   recommendations from Frans Klaver and Greg K-H.
>
> - Patch was tested and built on next-20170609 and staging-testing.
> ---
>  drivers/staging/wlan-ng/hfa384x.h    | 18 +++++++++---------
>  drivers/staging/wlan-ng/prism2mgmt.c |  2 +-
>  2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
> index 310e2c4..f99cc04 100644
> --- a/drivers/staging/wlan-ng/hfa384x.h
> +++ b/drivers/staging/wlan-ng/hfa384x.h
> @@ -358,7 +358,7 @@ struct hfa384x_bytestr {
>  } __packed;
>
>  struct hfa384x_bytestr32 {
> -       u16 len;
> +       __le16 len;
>         u8 data[32];
>  } __packed;
>
> @@ -399,8 +399,8 @@ struct hfa384x_caplevel {
>
>  /*-- Configuration Record: HostScanRequest (data portion only) --*/
>  struct hfa384x_host_scan_request_data {
> -       u16 channel_list;
> -       u16 tx_rate;
> +       __le16 channel_list;
> +       __le16 tx_rate;
>         struct hfa384x_bytestr32 ssid;
>  } __packed;
>
> @@ -682,16 +682,16 @@ struct hfa384x_ch_info_result {
>
>  /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
>  struct hfa384x_hscan_result_sub {
> -       u16 chid;
> -       u16 anl;
> -       u16 sl;
> +       __le16 chid;
> +       __le16 anl;
> +       __le16 sl;
>         u8 bssid[WLAN_BSSID_LEN];
> -       u16 bcnint;
> -       u16 capinfo;
> +       __le16 bcnint;
> +       __le16 capinfo;
>         struct hfa384x_bytestr32 ssid;
>         u8 supprates[10];       /* 802.11 info element */
>         u16 proberesp_rate;
> -       u16 atim;
> +       __le16 atim;
>  } __packed;
>
>  struct hfa384x_hscan_result {
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index f4d6e48..c4aa9e7 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -213,7 +213,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>                 goto exit;
>         }
>         if (word == HFA384x_PORTSTATUS_DISABLED) {
> -               u16 wordbuf[17];
> +               __le16 wordbuf[17];
>
>                 result = hfa384x_drvr_setconfig16(hw,
>                                         HFA384x_RID_CNFROAMINGMODE,
> --
> 1.9.1
>

Cheers,
Frans

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

* [PATCH v3] staging: wlan-ng: Fix struct definition's and variable type
  2017-06-15 10:03     ` Frans Klaver
@ 2017-06-16  5:31       ` sunil.m
  0 siblings, 0 replies; 7+ messages in thread
From: sunil.m @ 2017-06-16  5:31 UTC (permalink / raw)
  To: gregkh
  Cc: sergio.paracuellos, geo.emmnl, sfaragnaus, karniksayli1995,
	fransklaver, devel, linux-kernel, Suniel Mahesh

From: Suniel Mahesh <sunil.m@techveda.org>

le16_to_cpu() accepts argument of type __le16 and cpu_to_le16()
returns an argument of type __le16. This patch fixes:
(a) the type of the variable that end's up getting return from
    cpu_to_le16().
(b) the member types of struct hfa384x_host_scan_request_data,
    struct hfa384x_bytestr32 and struct hfa384x_hscan_result_sub.

The following type mismatch warnings reported by sparse
have been fixed:
warning: incorrect type in assignment (different base types)
warning: cast to restricted __le16

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
---
Changes for v3:
- Edited subject and description of the patch to fit with the changes
  done in the code base, as suggested by Frans Klaver.

Changes for v2:
- Reworked on the patch and modified commit message as per the
  recommendations from Frans Klaver and Greg K-H.

- Patch was tested and built on next-20170609 and staging-testing.
---
 drivers/staging/wlan-ng/hfa384x.h    | 18 +++++++++---------
 drivers/staging/wlan-ng/prism2mgmt.c |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
index 310e2c4..f99cc04 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -358,7 +358,7 @@ struct hfa384x_bytestr {
 } __packed;
 
 struct hfa384x_bytestr32 {
-	u16 len;
+	__le16 len;
 	u8 data[32];
 } __packed;
 
@@ -399,8 +399,8 @@ struct hfa384x_caplevel {
 
 /*-- Configuration Record: HostScanRequest (data portion only) --*/
 struct hfa384x_host_scan_request_data {
-	u16 channel_list;
-	u16 tx_rate;
+	__le16 channel_list;
+	__le16 tx_rate;
 	struct hfa384x_bytestr32 ssid;
 } __packed;
 
@@ -682,16 +682,16 @@ struct hfa384x_ch_info_result {
 
 /*--  Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
 struct hfa384x_hscan_result_sub {
-	u16 chid;
-	u16 anl;
-	u16 sl;
+	__le16 chid;
+	__le16 anl;
+	__le16 sl;
 	u8 bssid[WLAN_BSSID_LEN];
-	u16 bcnint;
-	u16 capinfo;
+	__le16 bcnint;
+	__le16 capinfo;
 	struct hfa384x_bytestr32 ssid;
 	u8 supprates[10];	/* 802.11 info element */
 	u16 proberesp_rate;
-	u16 atim;
+	__le16 atim;
 } __packed;
 
 struct hfa384x_hscan_result {
diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index f4d6e48..c4aa9e7 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -213,7 +213,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
 		goto exit;
 	}
 	if (word == HFA384x_PORTSTATUS_DISABLED) {
-		u16 wordbuf[17];
+		__le16 wordbuf[17];
 
 		result = hfa384x_drvr_setconfig16(hw,
 					HFA384x_RID_CNFROAMINGMODE,
-- 
1.9.1

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

end of thread, other threads:[~2017-06-16  5:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 17:15 [PATCH] staging: wlan-ng: Amend type mismatch warnings sunil.m
2017-06-12 18:48 ` Frans Klaver
2017-06-12 20:10 ` Dan Carpenter
2017-06-13  9:23 ` Greg KH
2017-06-15  6:41   ` [PATCH v2] " sunil.m
2017-06-15 10:03     ` Frans Klaver
2017-06-16  5:31       ` [PATCH v3] staging: wlan-ng: Fix struct definition's and variable type sunil.m

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