staging: wilc1000: make use of put_unaligned_le32 in handle_set_wfi_drv_handler()
authorAjay Singh <ajay.kathat@microchip.com>
Sun, 2 Dec 2018 18:02:19 +0000 (18:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 08:48:45 +0000 (09:48 +0100)
Make use of put_unaligned_le32() function to pack the wid command buffer
for firmware.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.h

index 3f3b013db7405c1f62ade60176dab352fa686763..e179a8e5814c6ef7fdebc39ce05b5f42043364a2 100644 (file)
@@ -289,14 +289,8 @@ static void handle_set_wfi_drv_handler(struct work_struct *work)
                goto free_msg;
 
        currbyte = buffer;
-       *currbyte = hif_drv->driver_handler_id & DRV_HANDLER_MASK;
-       currbyte++;
-       *currbyte = (u32)0 & DRV_HANDLER_MASK;
-       currbyte++;
-       *currbyte = (u32)0 & DRV_HANDLER_MASK;
-       currbyte++;
-       *currbyte = (u32)0 & DRV_HANDLER_MASK;
-       currbyte++;
+       put_unaligned_le32(hif_drv->driver_handler_id, currbyte);
+       currbyte += 4;
        *currbyte = (hif_drv_handler->name | (hif_drv_handler->mode << 1));
 
        wid.id = WID_SET_DRV_HANDLER;
index 827934522d99a31652109bc6ae5ad71cc1e20caf..7a71cb6ac214d9277a684eaf44136d476be11653 100644 (file)
@@ -41,7 +41,6 @@ enum {
 #define WILC_ADD_STA_LENGTH                    40
 #define WILC_NUM_CONCURRENT_IFC                        2
 #define WILC_DRV_HANDLER_SIZE                  5
-#define DRV_HANDLER_MASK                       0x000000FF
 
 #define NUM_RSSI                5