From: "Christian A. Ehrhardt" <lk@c--e.de>
To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Christian A. Ehrhardt" <lk@c--e.de>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Samuel Čavoj" <samuel@cavoj.net>,
"Hans de Goede" <hdegoede@redhat.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Prashanth K" <quic_prashk@quicinc.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
"Saranya Gopal" <saranya.gopal@intel.com>,
"Haotien Hsu" <haotienh@nvidia.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Utkarsh Patel" <utkarsh.h.patel@intel.com>,
"Bjorn Andersson" <andersson@kernel.org>,
"Luca Weiss" <luca.weiss@fairphone.com>,
"Min-Hua Chen" <minhuadotchen@gmail.com>,
"Rob Herring" <robh@kernel.org>,
"Rajaram Regupathy" <rajaram.regupathy@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
"Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>
Subject: [RFC PATCH 1/6] usb: ucsi_glink: Fix endianness issues
Date: Sun, 18 Feb 2024 23:20:34 +0100 [thread overview]
Message-ID: <20240218222039.822040-2-lk@c--e.de> (raw)
In-Reply-To: <20240218222039.822040-1-lk@c--e.de>
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@c--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
next prev parent reply other threads:[~2024-02-18 22:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-18 22:20 [RFC PATCH 0/6] UCSI backend API refactoring Christian A. Ehrhardt
2024-02-18 22:20 ` Christian A. Ehrhardt [this message]
2024-02-18 22:20 ` [RFC PATCH 2/6] ucsi_ccg: Cleanup endianness confusion Christian A. Ehrhardt
2024-02-18 22:20 ` [RFC PATCH 3/6] usb: typec: ucsi: Make Version a parameter to ucsi_register Christian A. Ehrhardt
2024-02-18 22:20 ` [RFC PATCH 4/6] usb: typec: ucsi: Cache current CCI value in struct ucsi Christian A. Ehrhardt
2024-02-18 22:20 ` [RFC PATCH 5/6] usb: typec: ucsi: Introdcue ->read_data and ->write_data Christian A. Ehrhardt
2024-02-18 22:20 ` [RFC PATCH 6/6] usb: typec: ucsi: Convert a?sync_write to a?sync_cmd Christian A. Ehrhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240218222039.822040-2-lk@c--e.de \
--to=lk@c--e.de \
--cc=abhishekpandit@chromium.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=haotienh@nvidia.com \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-usb@vger.kernel.org \
--cc=luca.weiss@fairphone.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=minhuadotchen@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=quic_prashk@quicinc.com \
--cc=rajaram.regupathy@intel.com \
--cc=robh@kernel.org \
--cc=samuel@cavoj.net \
--cc=saranya.gopal@intel.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=utkarsh.h.patel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®