Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1666620
| From | Frans Klaver <fransklaver@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] staging: wlan-ng: Amend type mismatch warnings |
| Date | 2017-06-15 12:10 +0200 |
| Message-ID | <tSzSW-18C-29@gated-at.bofh.it> (permalink) |
| References | <tRQj8-6bD-27@gated-at.bofh.it> <tSwLo-7tX-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> 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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] staging: wlan-ng: Amend type mismatch warnings sunil.m@techveda.org - 2017-06-12 19:20 +0200
Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings Frans Klaver <fransklaver@gmail.com> - 2017-06-12 20:50 +0200
Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-12 22:20 +0200
Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings Greg KH <gregkh@linuxfoundation.org> - 2017-06-13 11:30 +0200
[PATCH v2] staging: wlan-ng: Amend type mismatch warnings sunil.m@techveda.org - 2017-06-15 08:50 +0200
Re: [PATCH v2] staging: wlan-ng: Amend type mismatch warnings Frans Klaver <fransklaver@gmail.com> - 2017-06-15 12:10 +0200
[PATCH v3] staging: wlan-ng: Fix struct definition's and variable type sunil.m@techveda.org - 2017-06-16 07:40 +0200
csiph-web