]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: wlan-ng: prism2mgmt.c: fixed a double endian conversion before calling hfa38...
authorAndrea della Porta <sfaragnaus@gmail.com>
Sat, 29 Apr 2017 06:30:23 +0000 (07:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 05:43:55 +0000 (07:43 +0200)
staging: wlan-ng: prism2mgmt.c: This patches fixes a double endian conversion.
cpu_to_le16() was called twice first in prism2mgmt_scan and again inside
hfa384x_drvr_setconfig16() for the same variable, hence it was swapped
twice. Incidentally, it also fixed the following sparse warning:

drivers/staging/wlan-ng/prism2mgmt.c:173:30: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/prism2mgmt.c:173:30:    expected unsigned short [unsigned] [usertype] word
drivers/staging/wlan-ng/prism2mgmt.c:173:30:    got restricted __le16 [usertype] <noident>

Unfortunately, only compile tested.

Signed-off-by: Andrea della Porta <sfaragnaus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2mgmt.c

index e23a0d0e7b09dd97451dd59ebd97c3fab4c05048..f4d6e48499873af244afb096840a2cd8f40f636c 100644 (file)
@@ -170,7 +170,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
                                     hw->ident_sta_fw.variant) >
            HFA384x_FIRMWARE_VERSION(1, 5, 0)) {
                if (msg->scantype.data != P80211ENUM_scantype_active)
-                       word = cpu_to_le16(msg->maxchanneltime.data);
+                       word = msg->maxchanneltime.data;
                else
                        word = 0;