From: Min-Hua Chen Date: Tue, 23 May 2023 16:23:12 +0000 (+0800) Subject: usb: typec: ucsi: correctly access opcode X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3c90c5a7fd425daaa62c4f82b4699aabd8e4edaa;p=linux.git usb: typec: ucsi: correctly access opcode hdr->opcode is __le32 type, use le32_to_cpu() to cast opcode to integer in the switch..case statement to fix the following sparse warnings: drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer No functional change. Signed-off-by: Min-Hua Chen Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230523162314.114274-1-minhuadotchen@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index b454a5159896a..1fe9cb5b6bd96 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -245,7 +245,7 @@ static void pmic_glink_ucsi_callback(const void *data, size_t len, void *priv) struct pmic_glink_ucsi *ucsi = priv; const struct pmic_glink_hdr *hdr = data; - switch (hdr->opcode) { + switch (le32_to_cpu(hdr->opcode)) { case UC_UCSI_READ_BUF_REQ: pmic_glink_ucsi_read_ack(ucsi, data, len); break;