summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx/main.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-05-12 17:04:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-13 13:49:45 +0200
commitecda229e7ce3224fe9937d23c41e5ef74d4e6db3 (patch)
tree6cb78ea3d18434771f135c64e5a5b7144b0516fd /drivers/staging/wfx/main.c
parent808fcf2e976d0afd3279a2b85fa9dcb4a0c26d85 (diff)
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>
Diffstat (limited to 'drivers/staging/wfx/main.c')
-rw-r--r--drivers/staging/wfx/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 25d70ebe9933..d4e69c663f5a 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -229,7 +229,7 @@ int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len)
buf[i] = '}';
ret = hif_configuration(wdev, buf + start,
i - start + 1);
- if (ret == HIF_STATUS_FAILURE) {
+ if (ret > 0) {
dev_err(wdev->dev, "PDS bytes %d to %d: invalid data (unsupported options?)\n", start, i);
return -EINVAL;
}