staging: wlan-ng: Fix sparse warnings about endianness
authorEric Salem <ericsalem@gmail.com>
Wed, 11 Jan 2017 04:48:51 +0000 (22:48 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jan 2017 17:08:57 +0000 (18:08 +0100)
Fixed sparse warnings about endianness. E.g.:

warning: cast to restricted __le16

Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x.h

index 60caf9c3772712ab7a4423de57afcc4daed9aca7..5f1851c85f12d3c12b597dd480e101df6fad98b7 100644 (file)
@@ -1388,13 +1388,13 @@ static inline int hfa384x_drvr_getconfig16(struct hfa384x *hw, u16 rid, void *va
 
        result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
        if (result == 0)
-               *((u16 *)val) = le16_to_cpu(*((u16 *)val));
+               le16_to_cpus(val);
        return result;
 }
 
 static inline int hfa384x_drvr_setconfig16(struct hfa384x *hw, u16 rid, u16 val)
 {
-       u16 value = cpu_to_le16(val);
+       __le16 value = cpu_to_le16(val);
 
        return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
 }