ALSA: hda: cs35l41: Fix endian conversions
authorStefan Binding <sbinding@opensource.cirrus.com>
Tue, 6 Jun 2023 10:34:35 +0000 (11:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 6 Jun 2023 12:32:05 +0000 (14:32 +0200)
Found during static analysis, ensure variables are correct
types before endian conversion.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230606103436.455348-3-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c

index d100189e15b8362fed9226bf907dcff251737a66..ce5faa62051700ae04540b7b84c85bff27b20790 100644 (file)
@@ -308,8 +308,8 @@ out:
 }
 
 #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;
 
@@ -745,7 +745,7 @@ err:
 
 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;
        }