[PATCH v2 09/17] staging: wfx: fix access to le32 attribute 'event_id'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>

The attribute event_id is little-endian. We have to take to the
endianness when we access it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>
---
 drivers/staging/wfx/hif_rx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 87d5107a7757..966315edbab8 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -158,6 +158,7 @@ static int hif_event_indication(struct wfx_dev *wdev,
 {
 	struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
 	const struct hif_ind_event *body = buf;
+	int type = le32_to_cpu(body->event_id);
 	int cause;
 
 	if (!wvif) {
@@ -165,7 +166,7 @@ static int hif_event_indication(struct wfx_dev *wdev,
 		return 0;
 	}
 
-	switch (body->event_id) {
+	switch (type) {
 	case HIF_EVENT_IND_RCPI_RSSI:
 		wfx_event_report_rssi(wvif, body->event_data.rcpi_rssi);
 		break;
@@ -187,7 +188,7 @@ static int hif_event_indication(struct wfx_dev *wdev,
 		break;
 	default:
 		dev_warn(wdev->dev, "unhandled event indication: %.2x\n",
-			 body->event_id);
+			 type);
 		break;
 	}
 	return 0;
-- 
2.26.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux