mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Takashi Iwai" <tiwai@suse.de>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Curtis Malainey" <cujomalainey@chromium.org>,
	"Dmitry Antipov" <dmantipov@yandex.ru>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] ALSA: fix function cast warnings
Date: Tue, 13 Feb 2024 14:30:56 +0100	[thread overview]
Message-ID: <6a52b971-227b-4433-bdf9-b4a69a41d061@app.fastmail.com> (raw)
In-Reply-To: <87il2sy13f.wl-tiwai@suse.de>

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@arndb.de>".

     Arnd

  reply	other threads:[~2024-02-13 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 10:09 Arnd Bergmann
2024-02-13 12:56 ` Takashi Iwai
2024-02-13 13:30   ` Arnd Bergmann [this message]
2024-02-13 13:52     ` Takashi Iwai

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=6a52b971-227b-4433-bdf9-b4a69a41d061@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=dmantipov@yandex.ru \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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

all inboxes | Powered by JetHome®