staging: wfx: fix endianness of the field 'channel_number'
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 12 May 2020 15:04:13 +0000 (17:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 May 2020 11:49:45 +0000 (13:49 +0200)
commitd99ce4a1e5a2d49185bffa2ea7f37df1ad51c649
tree254f153013e367daf665740a5b3a6239731924b6
parent8008b480e25b0c88e1d6768bd8a440babb787307
staging: wfx: fix endianness of the field 'channel_number'

The field 'channel_number' from the structs hif_ind_rx and hif_req_start
is a __le32. Sparse complains this field is not always correctly
accessed:

    drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types)
    drivers/staging/wfx/data_rx.c:95:55:    expected int chan
    drivers/staging/wfx/data_rx.c:95:55:    got restricted __le16 const [usertype] channel_number

However, the value of channel_number cannot be greater than 14 (this
device only support 2.4Ghz band). So, we only have to access to the
least significant byte. It is finally easier to declare it as an array
of bytes and only access to the first one.

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