diff mbox series

firmware: cs_dsp: Avoid using a u32 as a __be32 in cs_dsp_mock_mem_maps.c

Message ID 20241217113127.186736-1-rf@opensource.cirrus.com (mailing list archive)
State Accepted
Commit a5bd108d4a57d6c00372041c83e633a26fb450de
Headers show
Series firmware: cs_dsp: Avoid using a u32 as a __be32 in cs_dsp_mock_mem_maps.c | expand

Commit Message

Richard Fitzgerald Dec. 17, 2024, 11:31 a.m. UTC
In cs_dsp_mock_xm_header_drop_from_regmap_cache() for the ADSP2 case read
the big-endian firmware word into a dedicated __be32 variable instead of
using the same u32 for both the big-endian and cpu-endian value.

Fixes: 41e78c0f44f9 ("firmware: cs_dsp: Add mock DSP memory map for KUnit testing")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Mark Brown Dec. 17, 2024, 3:48 p.m. UTC | #1
On Tue, 17 Dec 2024 11:31:27 +0000, Richard Fitzgerald wrote:
> In cs_dsp_mock_xm_header_drop_from_regmap_cache() for the ADSP2 case read
> the big-endian firmware word into a dedicated __be32 variable instead of
> using the same u32 for both the big-endian and cpu-endian value.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] firmware: cs_dsp: Avoid using a u32 as a __be32 in cs_dsp_mock_mem_maps.c
      commit: a5bd108d4a57d6c00372041c83e633a26fb450de

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c b/drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c
index ae5d57bdcc2f..161272e47bda 100644
--- a/drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c
+++ b/drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c
@@ -526,7 +526,8 @@  void cs_dsp_mock_xm_header_drop_from_regmap_cache(struct cs_dsp_test *priv)
 {
 	unsigned int xm = cs_dsp_mock_base_addr_for_mem(priv, WMFW_ADSP2_XM);
 	unsigned int bytes;
-	u32 num_algs;
+	__be32 num_algs_be32;
+	unsigned int num_algs;
 
 	switch (priv->dsp->type) {
 	case WMFW_ADSP2:
@@ -536,8 +537,8 @@  void cs_dsp_mock_xm_header_drop_from_regmap_cache(struct cs_dsp_test *priv)
 		 */
 		regmap_raw_read(priv->dsp->regmap,
 				xm + (offsetof(struct wmfw_adsp2_id_hdr, n_algs) / 2),
-				&num_algs, sizeof(num_algs));
-		num_algs = be32_to_cpu(num_algs);
+				&num_algs_be32, sizeof(num_algs_be32));
+		num_algs = be32_to_cpu(num_algs_be32);
 		bytes = sizeof(struct wmfw_adsp2_id_hdr) +
 			(num_algs * sizeof(struct wmfw_adsp2_alg_hdr)) +
 			4 /* terminator word */;