Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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>
Link: https://patch.msgid.link/20241217113127.186736-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
a5bd108d 8bfb66c7

+4 -3
+4 -3
drivers/firmware/cirrus/test/cs_dsp_mock_mem_maps.c
··· 526 526 { 527 527 unsigned int xm = cs_dsp_mock_base_addr_for_mem(priv, WMFW_ADSP2_XM); 528 528 unsigned int bytes; 529 - u32 num_algs; 529 + __be32 num_algs_be32; 530 + unsigned int num_algs; 530 531 531 532 switch (priv->dsp->type) { 532 533 case WMFW_ADSP2: ··· 537 536 */ 538 537 regmap_raw_read(priv->dsp->regmap, 539 538 xm + (offsetof(struct wmfw_adsp2_id_hdr, n_algs) / 2), 540 - &num_algs, sizeof(num_algs)); 541 - num_algs = be32_to_cpu(num_algs); 539 + &num_algs_be32, sizeof(num_algs_be32)); 540 + num_algs = be32_to_cpu(num_algs_be32); 542 541 bytes = sizeof(struct wmfw_adsp2_id_hdr) + 543 542 (num_algs * sizeof(struct wmfw_adsp2_alg_hdr)) + 544 543 4 /* terminator word */;