lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ