From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
pierre-louis.bossart@linux.dev, ben.dooks@codethink.co.uk,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH v2] ASoC: SDCA: fix __leXX types in find_sdca_control_range
Date: Mon, 16 Nov 2026 14:23:14 +0000 [thread overview]
Message-ID: <20261116142314.3702643-1-ckeepax@opensource.cirrus.com> (raw)
From: Ben Dooks <ben.dooks@codethink.co.uk>
The find_sdca_control_range passes u16 and u32 values to the
leXX_to_cpu() functions. Change this type and for the data
loop use the le32_to_cpus() to convert the value.
Fixes the following sparse warnings:
sound/soc/sdca/sdca_functions.c:868:23: warning: cast to restricted __le16
sound/soc/sdca/sdca_functions.c:869:23: warning: cast to restricted __le16
sound/soc/sdca/sdca_functions.c:877:34: warning: cast to restricted __le32
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Changes since v1:
- Updated the data loop from le32_to_cpup to le32_to_cpus
sound/soc/sdca/sdca_functions.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index 1eb6418e132dc..a051825d61589 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -851,7 +851,7 @@ static int find_sdca_control_range(struct device *dev,
{
u8 *range_list;
int num_range;
- u16 *limits;
+ __le16 *limits;
int i;
num_range = fwnode_property_count_u8(control_node, "mipi-sdca-control-range");
@@ -869,7 +869,7 @@ static int find_sdca_control_range(struct device *dev,
fwnode_property_read_u8_array(control_node, "mipi-sdca-control-range",
range_list, num_range);
- limits = (u16 *)range_list;
+ limits = (__le16 *)range_list;
range->cols = le16_to_cpu(limits[0]);
range->rows = le16_to_cpu(limits[1]);
@@ -880,7 +880,7 @@ static int find_sdca_control_range(struct device *dev,
return -EINVAL;
for (i = 0; i < num_range; i++)
- range->data[i] = le32_to_cpu(range->data[i]);
+ le32_to_cpus(&range->data[i]);
return 0;
}
--
2.47.3
reply other threads:[~2026-11-16 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261116142314.3702643-1-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=ben.dooks@codethink.co.uk \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=yung-chuan.liao@linux.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®