staging: wimax/i2400m: don't change the endianness of one byte variable
authorMuhammad Usama Anjum <musamaanjum@gmail.com>
Thu, 18 Feb 2021 09:21:54 +0000 (14:21 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:25:25 +0000 (09:25 +0100)
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>
Link: https://lore.kernel.org/r/20210218092154.GA46388@LEGION
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wimax/i2400m/control.c
drivers/staging/wimax/i2400m/op-rfkill.c

index 1e270b2..b6b2788 100644 (file)
@@ -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))) {
index fbddf2e..a159808 100644 (file)
@@ -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);