staging: wfx: fix endianness of the struct hif_ind_startup
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 12 May 2020 15:04:09 +0000 (17:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 May 2020 11:49:44 +0000 (13:49 +0200)
commit4246fdbf8c1452c15a38b45803f2516f1244c3fa
tree406d4fab6d45a3d649cc5828c80f576e57215bf5
parent9fee675c2c670ea86205ff9d8211980e016c4dde
staging: wfx: fix endianness of the struct hif_ind_startup

The struct hif_ind_startup is received from the hardware. So it is
declared as little endian. However, it is also stored in the main driver
structure and used on different places in the driver. Sparse complains
about that:

    drivers/staging/wfx/data_tx.c:388:43: warning: restricted __le16 degrades to integer
    drivers/staging/wfx/bh.c:199:9: warning: restricted __le16 degrades to integer
    drivers/staging/wfx/bh.c:221:62: warning: restricted __le16 degrades to integer

In order to make Sparse happy and to keep access from the driver easy,
this patch declare hif_ind_startup with native endianness.

On reception of this struct, this patch takes care to do byte-swap and
keep Sparse happy.

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