Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<patches@opensource.cirrus.com>
Subject: Re: [PATCH RESEND v1 2/3] ALSA: hda: cs35l41: Fix endian conversions
Date: Mon, 5 Jun 2023 16:23:55 +0100	[thread overview]
Message-ID: <21d2e747-f911-e9d4-2c55-e31c76c9d2bc@opensource.cirrus.com> (raw)
In-Reply-To: <878rcyhwvk.wl-tiwai@suse.de>

Hi Takashi,

On 05/06/2023 14:17, Takashi Iwai wrote:
> On Mon, 05 Jun 2023 14:50:54 +0200,
> Stefan Binding wrote:
>> Hi Takashi,
>>
>> On 05/06/2023 08:21, Takashi Iwai wrote:
>>> On Thu, 25 May 2023 15:59:54 +0200,
>>> Stefan Binding wrote:
>>>> @@ -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));
>>> Do we really need those cast?  Even if yes, it must be with __force
>>> prefix for the endian cast in general.
>> These casts were added because we found some warnings when we ran the
>> static analyzer sparse locally.
>> I think these warnings are very minor, and we can drop this patch if
>> you prefer?
> The warnings must be bogus, or maybe pointing to other things?
> The cpu_to_be32() macro itself must return a __be32 value, hence it
> makes no sense to add an extra cast .
>
> If the static analysis still shows such a warning, it should be fixed
> differently -- either fix the analyzer or fix the cpu_to_be32() macro
> itself.
>
> The changes of the argument types to __be32 are fine.  I'm arguing
> only about those unnecessary cast.

You are correct, I double checked and the cast is not needed. I'll push 
up a v2.

Thanks,

Stefan

>
>
> thanks,
>
> Takashi

  reply	other threads:[~2023-06-05 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 13:59 [PATCH RESEND v1 0/3] Fixes and cleanup for CS35L41 HDA Stefan Binding
2023-05-25 13:59 ` [PATCH RESEND v1 1/3] ALSA: hda: cs35l41: Clean up Firmware Load Controls Stefan Binding
2023-05-25 13:59 ` [PATCH RESEND v1 2/3] ALSA: hda: cs35l41: Fix endian conversions Stefan Binding
2023-06-05  7:21   ` Takashi Iwai
2023-06-05 12:50     ` Stefan Binding
2023-06-05 13:17       ` Takashi Iwai
2023-06-05 15:23         ` Stefan Binding [this message]
2023-05-25 13:59 ` [PATCH RESEND v1 3/3] ALSA: hda/realtek: Delete cs35l41 component master during free Stefan Binding

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=21d2e747-f911-e9d4-2c55-e31c76c9d2bc@opensource.cirrus.com \
    --to=sbinding@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /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