]> git.baikalelectronics.ru Git - kernel.git/commit
staging: wfx: fix endianness of the field 'status'
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 12 May 2020 15:04:11 +0000 (17:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 May 2020 11:49:45 +0000 (13:49 +0200)
commit57166528748bc7eb7e13704802c49894cb6c5f73
tree6cb78ea3d18434771f135c64e5a5b7144b0516fd
parente95899372b555017c89257824b8f5d45df4bd3ca
staging: wfx: fix endianness of the field 'status'

The field 'status' appears in most of structs returned by the hardware.
This field is encoded as little endian. Sparse complains this field is
not always correctly accessed:

    drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/data_rx.c:84:16: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/data_tx.c:526:24: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/data_tx.c:569:23: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/hif_rx.c:128:33: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer
    drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer

In most of cases, this field is only compared with HIF_STATUS values.
Finally, it is more convenient to solve the problem by defining the
HIF_STATUS values directly in little endian.

It is also the right time to make some clean up in the HIF_STATUS names.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200512150414.267198-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_rx.c
drivers/staging/wfx/data_tx.c
drivers/staging/wfx/hif_api_cmd.h
drivers/staging/wfx/hif_api_general.h
drivers/staging/wfx/hif_rx.c
drivers/staging/wfx/hif_tx.c
drivers/staging/wfx/main.c
drivers/staging/wfx/traces.h