mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sunil.m@techveda.org
To: gregkh@linuxfoundation.org
Cc: sergio.paracuellos@gmail.com, geo.emmnl@gmail.com,
	sfaragnaus@gmail.com, karniksayli1995@gmail.com,
	fransklaver@gmail.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	Suniel Mahesh <sunil.m@techveda.org>
Subject: [PATCH v3] staging: wlan-ng: Fix struct definition's and variable type
Date: Fri, 16 Jun 2017 11:01:45 +0530	[thread overview]
Message-ID: <1497591105-4867-1-git-send-email-sunil.m@techveda.org> (raw)
In-Reply-To: <CAH6sp9MU_wHcx34HBkS3s9gPyT94or0xNHoHcNGP2HR0uj45rw@mail.gmail.com>

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

      reply	other threads:[~2017-06-16  5:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` sunil.m [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497591105-4867-1-git-send-email-sunil.m@techveda.org \
    --to=sunil.m@techveda.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=fransklaver@gmail.com \
    --cc=geo.emmnl@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=karniksayli1995@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergio.paracuellos@gmail.com \
    --cc=sfaragnaus@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome