From patchwork Mon Feb 26 17:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 206827 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2226657dyb; Mon, 26 Feb 2024 09:34:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWgLZ4Y261c+uG5sTWhJ+fe+SONYrOGe5Jb9ZzkJ4yww4pDxs2izfeexgufn6JkhMTQd1gGBuaSKES+JgFMMojOL+7eA== X-Google-Smtp-Source: AGHT+IEfJKddj7d92MeUBELL7SzKGxuEmNNRi7ipUv7y9nmqbwEsqWVuRt3Vx6/iPZz9KUjIVB8x X-Received: by 2002:a05:6102:2388:b0:471:c518:eca0 with SMTP id v8-20020a056102238800b00471c518eca0mr5119255vsr.34.1708968870572; Mon, 26 Feb 2024 09:34:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708968870; cv=pass; d=google.com; s=arc-20160816; b=qamvL7pV5jXsCLY8QbCdIGWDNxdJPF3e6ISVSsgB14JADzBUuBF0pvsl3N4Ufqbxy0 2PcKN1CQ9w8RFzMn+Exy+v6KpnBva8Hz6pHSGU+1QJu4nGrxAHX5wdt7R/BbyUIDjha1 dzTgrcTpJNxjZExWQUnkFV7mW5+jxsL2zsSzHrLXi78hKFRR+JTc3wOGdqgta8uyop1S f49zrFoHEPYCuGo80saKV1QrrvQSAsnvzEgqeDZw61E61adLGlYahY/L9snsWcAmKEoZ UFbq5mNDvhqbWU99E57G2OWAvvdy8fOxHnnOBsmMepamkhnA8ZjnkA2PcCOaw7V9cqyT 6pwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=MaYfpx4jqxqKQ4ygGfIX8XBKNx0fRub/o4Qatc3GlF4=; fh=2aEIbZ+AJ3X0j02dQlDT3AvM52pW7poIMINai/HILqk=; b=ezRz9/K1yyItWEpvs7xRAAylyMb2moVQj22Xwii8cTqq0HVq6buqgSOpTw5r0bRJg9 8rTLoRtFBRSN7TYAUTjzWNmwExPGA4/8r4ydgg5uuu1CCzGAL1GdFA2C3hhTu/dZrLkm iziRjgawBbqx0haXlZCba/ou+1MB8Pt/E9B1Wt5ZGWYC07LICe+J1T2V1jvxSNZtCKza 3TLJWYPI6FM4cu8nW9psIV9G9LwEIAPNoLporGDwqyrMQU7EnkuDlQqBUKJydSNn342I 25peHdokcAjUBooC7SNs/biOPwf4+G+kxDQF1VwWHooBa5IRx3WcL41USFl0OYo4RZNw 8nsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GOElx2h1; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-82070-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82070-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ij24-20020a0561025e9800b0046ed2957797si759851vsb.727.2024.02.26.09.34.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:34:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82070-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GOElx2h1; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-82070-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82070-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4C1861C2BD32 for ; Mon, 26 Feb 2024 17:34:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 138AE12F366; Mon, 26 Feb 2024 17:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GOElx2h1" Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAADF12F389 for ; Mon, 26 Feb 2024 17:32:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708968773; cv=none; b=biyUwKUHJUfsYJEcQMV8sibZSHGd+jd0Nnm1NNbOHwersdZYXrO6qswYT1uhlaE1DwJYdoxZ8yDRJMhQjnPPisJGG+QiggYr60KF4yP2QvM4AZwzVTLZHYDVExAuDSqSNBkCqoO/SJ72rFjPFAcFmQVZzLXcqq/YjJJ3Bchi5U8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708968773; c=relaxed/simple; bh=dcyaGfqQ8aucX+uJmQuZcf9wqW6CMLKxh3VcDhu7drg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VDMb0fMuHRNcO51tfttProJiQL3KZR9/JIpnzOmIIF83CVdocq0inHkZJdvKaJHtvjW/PKJ1HSl3t9vC/ZAegXWgAlOOiHzgg3deUqhOcqW3BIdFuZTHoK77atlen0HBfv71TO+pgBi6JD7CXSKwpzd5Bl1KXOM23VM5heFyECI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=GOElx2h1; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-787b5c68253so235046185a.2 for ; Mon, 26 Feb 2024 09:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708968771; x=1709573571; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MaYfpx4jqxqKQ4ygGfIX8XBKNx0fRub/o4Qatc3GlF4=; b=GOElx2h12cGPZDE1L5CsA6kWYbbHIDTJgGQ7U8/B7YVdbDdYPtHW5EOr8pBLsfdyar ScKJHjwsxfm8TI4fNMxjKffXLHB6OIptEn0joSP1ieMaA0P9JmfXr9we9ukr/dFfV+ZI jDB+aSEEhIYQPfExte4rZO+gSpMzQ3bE0YdyI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708968771; x=1709573571; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MaYfpx4jqxqKQ4ygGfIX8XBKNx0fRub/o4Qatc3GlF4=; b=ifY+pLlhp4VDB9B4GXm63/KnxfZ3P2mjQvcjIIWETVImzRK4oRIPaKHLwAuk0iLBXg KfRNafpas/oFbKbAJza5UX/BBSz4Sbax08VsgZOvquRfvKSlBUg2mLBQ45c9OMBd2776 ZuysF78KfnA4LoVfLQEDQfIIDbmPTv1iIEWOAY8vJ4vZRMXl3yTcZaH88tO1dV3BHsrq 3XGIwMPw9qGiHqFS4Ztiu89iQJqvpBZkE4FNEcNh+PwyfOvfhekPU5P7gaCs9oKbPGd8 P9C4v6m4sau1kmlkTh/gghAv8ybEm+OPC6HZN+kATOkvDx64XcL3KzlMb+lALoGNoM4K zLgA== X-Forwarded-Encrypted: i=1; AJvYcCV8Fzgu1T6XwAS1MyQEHU7eUTSVMjwxwF+QhGErKcxqidk5UCJmj5FFzKXF6fINx3iF9RhULq1zBo+p9JloBCEmpFJ0Baus5am5hlWj X-Gm-Message-State: AOJu0YyuRAByaBqzHpLfFCwhgmm8PQUZwNxtE8qly+erknMF9HBB0Q+C ojC21MIxV7+bUrJTDAI4bEscdyk6qUGK5E1i11nTuUrluE/aCVgDqHO2Med7yw== X-Received: by 2002:a05:620a:17aa:b0:787:c71f:a55c with SMTP id ay42-20020a05620a17aa00b00787c71fa55cmr7498759qkb.59.1708968770886; Mon, 26 Feb 2024 09:32:50 -0800 (PST) Received: from denia.c.googlers.com (115.25.199.35.bc.googleusercontent.com. [35.199.25.115]) by smtp.gmail.com with ESMTPSA id b11-20020a05620a04eb00b0078725d0345dsm2672669qkh.2.2024.02.26.09.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:32:50 -0800 (PST) From: Ricardo Ribalda Date: Mon, 26 Feb 2024 17:32:45 +0000 Subject: [PATCH v2 2/3] media: usb: pvrusb2: Fix Wcast-function-type-strict warnings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240226-fix-clang-warnings-v2-2-fa1bc931d17e@chromium.org> References: <20240226-fix-clang-warnings-v2-0-fa1bc931d17e@chromium.org> In-Reply-To: <20240226-fix-clang-warnings-v2-0-fa1bc931d17e@chromium.org> To: Mauro Carvalho Chehab , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Mike Isely , Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Matthias Brugger , AngeloGioacchino Del Regno , Bjorn Andersson , Mathieu Poirier Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-remoteproc@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791983742317930430 X-GMAIL-MSGID: 1791983742317930430 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] Reviewed-by: Nathan Chancellor Signed-off-by: Ricardo Ribalda --- 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);