[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6a52b971-227b-4433-bdf9-b4a69a41d061@app.fastmail.com>
Date: Tue, 13 Feb 2024 14:30:56 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Takashi Iwai" <tiwai@...e.de>, "Arnd Bergmann" <arnd@...nel.org>
Cc: "Jaroslav Kysela" <perex@...ex.cz>, "Takashi Iwai" <tiwai@...e.com>,
"Nathan Chancellor" <nathan@...nel.org>,
"Nick Desaulniers" <ndesaulniers@...gle.com>,
"Bill Wendling" <morbo@...gle.com>, "Justin Stitt" <justinstitt@...gle.com>,
"Curtis Malainey" <cujomalainey@...omium.org>,
"Dmitry Antipov" <dmantipov@...dex.ru>, linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] ALSA: fix function cast warnings
On Tue, Feb 13, 2024, at 13:56, Takashi Iwai wrote:
> On Tue, 13 Feb 2024 11:09:56 +0100,
>>
>> -int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
>> - const unsigned char *buffer, int count);
>> +int snd_rawmidi_receive(void *ptr, const void *buffer, int count);
>
> If it were only about the type of the buffer argument being a void
> pointer, it's fine. But the substream argument should be explicitly
> typed, otherwise it's confusing for other normal call patterns.
>
> I guess the suitable fix for now would be to provide wrapper functions
> that are used for callbacks and bridge to the actual function with
> pointer cast, something like below. Eventually we can put more const,
> but it's basically irrelevant with the warning itself.
Right, makes sense. I gave your patch a spin and it addresses the
warnings I saw in randconfig builds, so please apply that with
"Reported-by: Arnd Bergmann <arnd@...db.de>".
Arnd
Powered by blists - more mailing lists