lkml.org 
[lkml]   [2023]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/4] ALSA: hda: cs35l41: Fix endian conversions
Date
Found during static analysis, ensure variables are correct
types before endian conversion.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/pci/hda/cs35l41_hda.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index d100189e15b83..b02462ae21f04 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -308,8 +308,8 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41,
}

#if IS_ENABLED(CONFIG_EFI)
-static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, unsigned int ambient,
- unsigned int r0, unsigned int status, unsigned int checksum)
+static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, __be32 ambient, __be32 r0,
+ __be32 status, __be32 checksum)
{
int ret;

@@ -379,10 +379,10 @@ static int cs35l41_save_calibration(struct cs35l41_hda *cs35l41)

/* Calibration can only be applied whilst the DSP is not running */
ret = cs35l41_apply_calibration(cs35l41,
- cpu_to_be32(cl->calAmbient),
- cpu_to_be32(cl->calR),
- cpu_to_be32(cl->calStatus),
- cpu_to_be32(cl->calR + 1));
+ (__be32)cpu_to_be32(cl->calAmbient),
+ (__be32)cpu_to_be32(cl->calR),
+ (__be32)cpu_to_be32(cl->calStatus),
+ (__be32)cpu_to_be32(cl->calR + 1));
}
}
vfree(data);
@@ -745,7 +745,7 @@ static int cs35l41_runtime_resume(struct device *dev)

static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
{
- int halo_sts;
+ __be32 halo_sts;
int ret;

ret = cs35l41_init_dsp(cs35l41);
@@ -773,7 +773,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
&halo_sts, sizeof(halo_sts));

if (ret) {
- dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %d\n",
+ dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %u\n",
halo_sts);
goto clean_dsp;
}
--
2.34.1
\
 
 \ /
  Last update: 2023-04-14 17:28    [W:0.080 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site