Commit 4e0b3a43 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix up endian issues found by sparse in io_edgeport.c driver

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent adddb9fd
...@@ -2917,7 +2917,7 @@ static void load_application_firmware (struct edgeport_serial *edge_serial) ...@@ -2917,7 +2917,7 @@ static void load_application_firmware (struct edgeport_serial *edge_serial)
record = (struct edge_firmware_image_record *)firmware; record = (struct edge_firmware_image_record *)firmware;
response = sram_write (edge_serial->serial, le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr), le16_to_cpu(record->Len), &record->Data[0]); response = sram_write (edge_serial->serial, le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr), le16_to_cpu(record->Len), &record->Data[0]);
if (response < 0) { if (response < 0) {
dev_err(&edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr), record->Len); dev_err(&edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", le16_to_cpu(record->ExtAddr), le16_to_cpu(record->Addr), le16_to_cpu(record->Len));
break; break;
} }
firmware += sizeof (struct edge_firmware_image_record) + le16_to_cpu(record->Len); firmware += sizeof (struct edge_firmware_image_record) + le16_to_cpu(record->Len);
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD)
#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD
struct edge_firmware_image_record { struct edge_firmware_image_record {
unsigned short ExtAddr; __le16 ExtAddr;
unsigned short Addr; __le16 Addr;
unsigned short Len; __le16 Len;
unsigned char Data[0]; unsigned char Data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD)
#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD
struct edge_firmware_image_record { struct edge_firmware_image_record {
unsigned short ExtAddr; __le16 ExtAddr;
unsigned short Addr; __le16 Addr;
unsigned short Len; __le16 Len;
unsigned char Data[0]; unsigned char Data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD)
#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD
struct edge_firmware_image_record { struct edge_firmware_image_record {
unsigned short ExtAddr; __le16 ExtAddr;
unsigned short Addr; __le16 Addr;
unsigned short Len; __le16 Len;
unsigned char Data[0]; unsigned char Data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD)
#define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD
struct edge_firmware_image_record { struct edge_firmware_image_record {
unsigned short ExtAddr; __le16 ExtAddr;
unsigned short Addr; __le16 Addr;
unsigned short Len; __le16 Len;
unsigned char Data[0]; unsigned char Data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment