diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2018-08-01 16:41:00 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-02 09:41:37 +0200 |
commit | 02211edc9a1f71942a67d545614f8c7382230de7 (patch) | |
tree | cb8b875d2ff54424504c4f98957162be3a951b58 /drivers/staging/wilc1000/wilc_sdio.c | |
parent | 41203a451b6c9f6458195d9c0de964bf33c52e93 (diff) |
staging: wilc1000: fix endianness warnings reported by sparse
This patch fixes the sparse warnings by making use of le32_to_cpus() &
cpu_to_le32s() conversion API's.
Remove the unnecessary byte-order conversion in
wilc_wlan_parse_response_frame() as the data is copied using individual
byte operation.
Also added the byte-order conversion for 'header' in
wilc_wfi_monitor_rx() & wilc_wfi_p2p_rx() as received in LE byte-order.
The link [1] contains the details of discussion related to this patch.
[1]. https://patchwork.kernel.org/patch/10436791/
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_sdio.c')
-rw-r--r-- | drivers/staging/wilc1000/wilc_sdio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 0628237cdcf4..8bda55018e3e 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -384,7 +384,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) struct sdio_func *func = dev_to_sdio_func(wilc->dev); int ret; - data = cpu_to_le32(data); + cpu_to_le32s(&data); if (addr >= 0xf0 && addr <= 0xff) { struct sdio_cmd52 cmd; @@ -563,7 +563,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) } } - *data = cpu_to_le32(*data); + le32_to_cpus(*data); return 1; |