Re: [PATCH] firewire: fix function type cast warning
From: Arnd Bergmann
Date: Tue Oct 27 2020 - 08:48:33 EST
On Tue, Oct 27, 2020 at 1:13 AM Takashi Sakamoto
<o-takashi@xxxxxxxxxxxxx> wrote:
> On Mon, Oct 26, 2020 at 10:51:27PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > gcc -Wextra complains about a suspicious cast:
> >
> > rivers/firewire/core-cdev.c:985:8: warning: cast between incompatible function types from ‘void (*)(struct fw_iso_context *, dma_addr_t, void *)’ {aka ‘void (*)(struct fw_iso_context *, long long unsigned int, void *)’} to ‘void (*)(struct fw_iso_context *, u32, size_t, void *, void *)’ {aka ‘void (*)(struct fw_iso_context *, unsigned int, long unsigned int, void *, void *)’} [-Wcast-function-type]
> >
> > The behavior is correct in the end, but this is more clearly
> > expressed using a transparent union.
> >
> > Fixes: 872e330e3880 ("firewire: add isochronous multichannel reception")
> > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> > ---
> > drivers/firewire/core-cdev.c | 6 +++---
> > drivers/firewire/core-iso.c | 2 +-
> > include/linux/firewire.h | 17 ++++++++---------
> > 3 files changed, 12 insertions(+), 13 deletions(-)
>
> Oscar Carter has posted a patch to fix it.
> https://sourceforge.net/p/linux1394/mailman/message/37024966/
>
> I don't know exactly but maintainers seems to overlook it...
Right, that seems fairly similar to my version but avoids the GNU
extension, so it would be better that version.
Arnd