[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240218222039.822040-2-lk@c--e.de>
Date: Sun, 18 Feb 2024 23:20:34 +0100
From: "Christian A. Ehrhardt" <lk@...e.de>
To: linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: "Christian A. Ehrhardt" <lk@...e.de>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Samuel Čavoj <samuel@...oj.net>,
Hans de Goede <hdegoede@...hat.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Prashanth K <quic_prashk@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Saranya Gopal <saranya.gopal@...el.com>,
Haotien Hsu <haotienh@...dia.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Utkarsh Patel <utkarsh.h.patel@...el.com>,
Bjorn Andersson <andersson@...nel.org>,
Luca Weiss <luca.weiss@...rphone.com>,
Min-Hua Chen <minhuadotchen@...il.com>,
Rob Herring <robh@...nel.org>,
Rajaram Regupathy <rajaram.regupathy@...el.com>,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
Abhishek Pandit-Subedi <abhishekpandit@...omium.org>
Subject: [RFC PATCH 1/6] usb: ucsi_glink: Fix endianness issues
Sparse complains that some little endian header fields
are assigned from plain integer values.
Add the proper cpu_to_le32() calls.
Signed-off-by: Christian A. Ehrhardt <lk@...e.de>
---
drivers/usb/typec/ucsi/ucsi_glink.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
index 0bd3f6dee678..0a0d08467c56 100644
--- a/drivers/usb/typec/ucsi/ucsi_glink.c
+++ b/drivers/usb/typec/ucsi/ucsi_glink.c
@@ -85,9 +85,9 @@ static int pmic_glink_ucsi_read(struct ucsi *__ucsi, unsigned int offset,
unsigned long left;
int ret;
- req.hdr.owner = PMIC_GLINK_OWNER_USBC;
- req.hdr.type = MSG_TYPE_REQ_RESP;
- req.hdr.opcode = UC_UCSI_READ_BUF_REQ;
+ req.hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_USBC);
+ req.hdr.type = cpu_to_le32(MSG_TYPE_REQ_RESP);
+ req.hdr.opcode = cpu_to_le32(UC_UCSI_READ_BUF_REQ);
mutex_lock(&ucsi->lock);
memset(ucsi->read_buf, 0, sizeof(ucsi->read_buf));
@@ -122,9 +122,9 @@ static int pmic_glink_ucsi_locked_write(struct pmic_glink_ucsi *ucsi, unsigned i
unsigned long left;
int ret;
- req.hdr.owner = PMIC_GLINK_OWNER_USBC;
- req.hdr.type = MSG_TYPE_REQ_RESP;
- req.hdr.opcode = UC_UCSI_WRITE_BUF_REQ;
+ req.hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_USBC);
+ req.hdr.type = cpu_to_le32(MSG_TYPE_REQ_RESP);
+ req.hdr.opcode = cpu_to_le32(UC_UCSI_WRITE_BUF_REQ);
memcpy(&req.buf[offset], val, val_len);
reinit_completion(&ucsi->write_ack);
--
2.40.1
Powered by blists - more mailing lists