diff options
author | Ben Chan <benchan@chromium.org> | 2014-06-30 23:32:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 11:49:16 -0700 |
commit | a8a175d9fc2ddb513baf5f043c1e9de512f886f7 (patch) | |
tree | 6ad60b4b0527226717ed8090fea1444c719eded9 /drivers/staging/gdm72xx/gdm_usb.c | |
parent | bbd500d8cdb071e7964fc07ab988817d719e1578 (diff) |
staging: gdm72xx: clean up endianness conversions
This patch cleans up the endianness conversions in the gdm72xx driver:
- Directly use the generic byte-reordering macros for endianness
conversion instead of some custom-defined macros.
- Convert values on the constant side instead of the variable side when
appropriate.
- Add endianness annotations.
Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm72xx/gdm_usb.c')
-rw-r--r-- | drivers/staging/gdm72xx/gdm_usb.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c index 971976cd8d0c..5a6b86a180b3 100644 --- a/drivers/staging/gdm72xx/gdm_usb.c +++ b/drivers/staging/gdm72xx/gdm_usb.c @@ -36,10 +36,6 @@ MODULE_DEVICE_TABLE(usb, id_table); #define GDM7205_PADDING 256 -#define H2B(x) __cpu_to_be16(x) -#define B2H(x) __be16_to_cpu(x) -#define DB2H(x) __be32_to_cpu(x) - #define DOWNLOAD_CONF_VALUE 0x21 #ifdef CONFIG_WIMAX_GDM72XX_K_MODE @@ -541,9 +537,9 @@ static int gdm_usb_probe(struct usb_interface *intf, bConfigurationValue = usbdev->actconfig->desc.bConfigurationValue; /*USB description is set up with Little-Endian*/ - idVendor = L2H(usbdev->descriptor.idVendor); - idProduct = L2H(usbdev->descriptor.idProduct); - bcdDevice = L2H(usbdev->descriptor.bcdDevice); + idVendor = le16_to_cpu(usbdev->descriptor.idVendor); + idProduct = le16_to_cpu(usbdev->descriptor.idProduct); + bcdDevice = le16_to_cpu(usbdev->descriptor.bcdDevice); dev_info(&intf->dev, "Found GDM USB VID = 0x%04x PID = 0x%04x...\n", idVendor, idProduct); @@ -626,7 +622,7 @@ static void gdm_usb_disconnect(struct usb_interface *intf) phy_dev = usb_get_intfdata(intf); /*USB description is set up with Little-Endian*/ - idProduct = L2H(usbdev->descriptor.idProduct); + idProduct = le16_to_cpu(usbdev->descriptor.idProduct); if (idProduct != EMERGENCY_PID && bConfigurationValue != DOWNLOAD_CONF_VALUE && |