staging: wlan-ng: convert endianness in situ for prism2fw
authorThibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>
Fri, 12 May 2017 09:37:54 +0000 (11:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 10:47:55 +0000 (12:47 +0200)
Fix several sparse warnings about casts to restricted
little-endian.

Signed-off-by: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2fw.c

index afd877f..1a0c786 100644 (file)
@@ -617,28 +617,28 @@ static int mkpdrlist(struct pda *pda)
                    HFA384x_PDR_NICID) {
                        memcpy(&nicid, &pda->rec[pda->nrec]->data.nicid,
                               sizeof(nicid));
-                       nicid.id = le16_to_cpu(nicid.id);
-                       nicid.variant = le16_to_cpu(nicid.variant);
-                       nicid.major = le16_to_cpu(nicid.major);
-                       nicid.minor = le16_to_cpu(nicid.minor);
+                       le16_to_cpus(&nicid.id);
+                       le16_to_cpus(&nicid.variant);
+                       le16_to_cpus(&nicid.major);
+                       le16_to_cpus(&nicid.minor);
                }
                if (le16_to_cpu(pda->rec[pda->nrec]->code) ==
                    HFA384x_PDR_MFISUPRANGE) {
                        memcpy(&rfid, &pda->rec[pda->nrec]->data.mfisuprange,
                               sizeof(rfid));
-                       rfid.id = le16_to_cpu(rfid.id);
-                       rfid.variant = le16_to_cpu(rfid.variant);
-                       rfid.bottom = le16_to_cpu(rfid.bottom);
-                       rfid.top = le16_to_cpu(rfid.top);
+                       le16_to_cpus(&rfid.id);
+                       le16_to_cpus(&rfid.variant);
+                       le16_to_cpus(&rfid.bottom);
+                       le16_to_cpus(&rfid.top);
                }
                if (le16_to_cpu(pda->rec[pda->nrec]->code) ==
                    HFA384x_PDR_CFISUPRANGE) {
                        memcpy(&macid, &pda->rec[pda->nrec]->data.cfisuprange,
                               sizeof(macid));
-                       macid.id = le16_to_cpu(macid.id);
-                       macid.variant = le16_to_cpu(macid.variant);
-                       macid.bottom = le16_to_cpu(macid.bottom);
-                       macid.top = le16_to_cpu(macid.top);
+                       le16_to_cpus(&macid.id);
+                       le16_to_cpus(&macid.variant);
+                       le16_to_cpus(&macid.bottom);
+                       le16_to_cpus(&macid.top);
                }
 
                (pda->nrec)++;