driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: wimax/i2400m: don't change the endianness of one byte variable
@ 2021-02-18  9:21 Muhammad Usama Anjum
  2021-02-18  9:40 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Muhammad Usama Anjum @ 2021-02-18  9:21 UTC (permalink / raw)
  To: gregkh, lee.jones, johannes, arnd, kuba, gustavoars, wanghai38,
	devel, linux-kernel
  Cc: musamaanjum

It is wrong to change the endianness of a variable which has just one
byte size.

Sparse warnings fixed:
drivers/staging//wimax/i2400m/control.c:452:17: warning: cast to restricted __le32
drivers/staging//wimax/i2400m/control.c:452:17: warning: cast to restricted __le32
drivers/staging//wimax/i2400m/op-rfkill.c:159:14: warning: cast to restricted __le32
drivers/staging//wimax/i2400m/op-rfkill.c:160:14: warning: cast to restricted __le32

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
---
 drivers/staging/wimax/i2400m/control.c   | 4 ++--
 drivers/staging/wimax/i2400m/op-rfkill.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wimax/i2400m/control.c b/drivers/staging/wimax/i2400m/control.c
index 1e270b2101e8..b6b2788af162 100644
--- a/drivers/staging/wimax/i2400m/control.c
+++ b/drivers/staging/wimax/i2400m/control.c
@@ -452,8 +452,8 @@ void i2400m_report_state_parse_tlv(struct i2400m *i2400m,
 		d_printf(2, dev, "%s: RF status TLV "
 			 "found (0x%04x), sw 0x%02x hw 0x%02x\n",
 			 tag, I2400M_TLV_RF_STATUS,
-			 le32_to_cpu(rfss->sw_rf_switch),
-			 le32_to_cpu(rfss->hw_rf_switch));
+			 rfss->sw_rf_switch,
+			 rfss->hw_rf_switch);
 		i2400m_report_tlv_rf_switches_status(i2400m, rfss);
 	}
 	if (0 == i2400m_tlv_match(tlv, I2400M_TLV_MEDIA_STATUS, sizeof(*ms))) {
diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c
index fbddf2e18c14..a159808f0ec2 100644
--- a/drivers/staging/wimax/i2400m/op-rfkill.c
+++ b/drivers/staging/wimax/i2400m/op-rfkill.c
@@ -156,8 +156,8 @@ void i2400m_report_tlv_rf_switches_status(
 	enum i2400m_rf_switch_status hw, sw;
 	enum wimax_st wimax_state;
 
-	sw = le32_to_cpu(rfss->sw_rf_switch);
-	hw = le32_to_cpu(rfss->hw_rf_switch);
+	sw = rfss->sw_rf_switch;
+	hw = rfss->hw_rf_switch;
 
 	d_fnstart(3, dev, "(i2400m %p rfss %p [hw %u sw %u])\n",
 		  i2400m, rfss, hw, sw);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2021-02-18 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  9:21 [PATCH] staging: wimax/i2400m: don't change the endianness of one byte variable Muhammad Usama Anjum
2021-02-18  9:40 ` Greg KH
2021-02-18  9:54   ` Muhammad Usama Anjum
2021-02-18 18:32     ` Arnd Bergmann

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