[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ab5e7379-8a55-43d1-b784-8d89aae250c3@xs4all.nl>
Date: Wed, 28 Feb 2024 09:01:12 +0100
From: Hans Verkuil <hverkuil@...all.nl>
To: Ricardo Ribalda <ribalda@...omium.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Mike Isely <isely@...ox.com>, Tiffany Lin <tiffany.lin@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Yunfei Dong <yunfei.dong@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Bjorn Andersson <andersson@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-remoteproc@...r.kernel.org
Subject: Re: [PATCH v2 2/3] media: usb: pvrusb2: Fix
Wcast-function-type-strict warnings
On 26/02/2024 18:32, Ricardo Ribalda wrote:
> Building with LLVM=1 throws the following warning:
> drivers/media/usb/pvrusb2/pvrusb2-context.c:110:6: warning: cast from 'void (*)(struct pvr2_context *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
> drivers/media/usb/pvrusb2/pvrusb2-v4l2.c:1070:30: warning: cast from 'void (*)(struct pvr2_v4l2_fh *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-strict] drivers/media/usb/pvrusb2/pvrusb2-dvb.c:152:6: warning: cast from 'void (*)(struct pvr2_dvb_adapter *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-strict]
This patch from Arnd has already been merged, superseding your patch:
https://lore.kernel.org/linux-media/20240213100439.457403-1-arnd@kernel.org/
Marking your patch as Obsolete in patchwork.
Regards,
Hans
>
> Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> ---
> drivers/media/usb/pvrusb2/pvrusb2-context.c | 5 +++--
> drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 7 ++++---
> drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 7 ++++---
> 3 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
> index 1764674de98bc..16edabda191c4 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
> @@ -90,8 +90,9 @@ static void pvr2_context_destroy(struct pvr2_context *mp)
> }
>
>
> -static void pvr2_context_notify(struct pvr2_context *mp)
> +static void pvr2_context_notify(void *data)
> {
> + struct pvr2_context *mp = data;
> pvr2_context_set_notify(mp,!0);
> }
>
> @@ -107,7 +108,7 @@ static void pvr2_context_check(struct pvr2_context *mp)
> "pvr2_context %p (initialize)", mp);
> /* Finish hardware initialization */
> if (pvr2_hdw_initialize(mp->hdw,
> - (void (*)(void *))pvr2_context_notify,
> + pvr2_context_notify,
> mp)) {
> mp->video_stream.stream =
> pvr2_hdw_get_video_stream(mp->hdw);
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
> index 26811efe0fb58..8b9f1a09bd53d 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
> @@ -88,8 +88,9 @@ static int pvr2_dvb_feed_thread(void *data)
> return stat;
> }
>
> -static void pvr2_dvb_notify(struct pvr2_dvb_adapter *adap)
> +static void pvr2_dvb_notify(void *data)
> {
> + struct pvr2_dvb_adapter *adap = data;
> wake_up(&adap->buffer_wait_data);
> }
>
> @@ -148,8 +149,8 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
> if (!(adap->buffer_storage[idx])) return -ENOMEM;
> }
>
> - pvr2_stream_set_callback(pvr->video_stream.stream,
> - (pvr2_stream_callback) pvr2_dvb_notify, adap);
> + pvr2_stream_set_callback(pvr->video_stream.stream, pvr2_dvb_notify,
> + adap);
>
> ret = pvr2_stream_set_buffer_count(stream, PVR2_DVB_BUFFER_COUNT);
> if (ret < 0) return ret;
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index c04ab7258d645..590f80949bbfc 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -1032,9 +1032,10 @@ static int pvr2_v4l2_open(struct file *file)
> return 0;
> }
>
> -
> -static void pvr2_v4l2_notify(struct pvr2_v4l2_fh *fhp)
> +static void pvr2_v4l2_notify(void *data)
> {
> + struct pvr2_v4l2_fh *fhp = data;
> +
> wake_up(&fhp->wait_data);
> }
>
> @@ -1067,7 +1068,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
>
> hdw = fh->channel.mc_head->hdw;
> sp = fh->pdi->stream->stream;
> - pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
> + pvr2_stream_set_callback(sp, pvr2_v4l2_notify, fh);
> pvr2_hdw_set_stream_type(hdw,fh->pdi->config);
> if ((ret = pvr2_hdw_set_streaming(hdw,!0)) < 0) return ret;
> return pvr2_ioread_set_enabled(fh->rhp,!0);
>
Powered by blists - more mailing lists