linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] staging: rtl8723au: fix sparse incorrect type assignment warnings
@ 2014-09-16 22:28 Kieron Browne
  2014-09-17  8:26 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Kieron Browne @ 2014-09-16 22:28 UTC (permalink / raw)
  To: Larry.Finger, Jes.Sorensen, gregkh, linux-wireless, devel,
	linux-kernel
  Cc: Kieron Browne

Use cpu_to_le16 to cast int for assignment to __le16 members

Signed-off-by: Kieron Browne <kieron.browne@gmail.com>
---
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
index efe4af8..f2615dc 100644
--- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
@@ -3169,13 +3169,13 @@ static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap,
 		ht_cap->mcs.rx_mask[1] = 0x00;
 		ht_cap->mcs.rx_mask[4] = 0x01;
 
-		ht_cap->mcs.rx_highest = MAX_BIT_RATE_40MHZ_MCS7;
+		ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS7);
 	} else if ((rf_type == RF_1T2R) || (rf_type == RF_2T2R)) {
 		ht_cap->mcs.rx_mask[0] = 0xFF;
 		ht_cap->mcs.rx_mask[1] = 0xFF;
 		ht_cap->mcs.rx_mask[4] = 0x01;
 
-		ht_cap->mcs.rx_highest = MAX_BIT_RATE_40MHZ_MCS15;
+		ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
 	} else {
 		DBG_8723A("%s, error rf_type =%d\n", __func__, rf_type);
 	}
-- 
1.9.1


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

* Re: [PATCH 1/1] staging: rtl8723au: fix sparse incorrect type assignment warnings
  2014-09-16 22:28 [PATCH 1/1] staging: rtl8723au: fix sparse incorrect type assignment warnings Kieron Browne
@ 2014-09-17  8:26 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-09-17  8:26 UTC (permalink / raw)
  To: Kieron Browne
  Cc: Larry.Finger, Jes.Sorensen, gregkh, linux-wireless, devel,
	linux-kernel

On Tue, Sep 16, 2014 at 11:28:09PM +0100, Kieron Browne wrote:
> Use cpu_to_le16 to cast int for assignment to __le16 members
> 

"cast" is the wrong word.  It's really doing a byte swap.  It fixes a
bug on big endian systems.

But the patch is ok and matches how the other rtl drivers do it.

regards,
dan carpenter


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

end of thread, other threads:[~2014-09-17  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-16 22:28 [PATCH 1/1] staging: rtl8723au: fix sparse incorrect type assignment warnings Kieron Browne
2014-09-17  8:26 ` Dan Carpenter

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