From patchwork Mon Feb 26 17:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13572570 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FE69C5478C for ; Mon, 26 Feb 2024 17:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YEXtO9nTlmKAeAccUiG/6PP0NKI+7T63CKILZTv+7Lg=; b=HGN/014AQC38Mg RGb7WeNs9bpxP0QjkO5Qhls2gYamWz3XX8uNCDlZk9+3iGLDrqSoRQAl9kZez78PlG3wUCn4W38wq AusV/RQhz2I2Fq7aesmHZyS2AgMr9CgBv8iiXHDqgqcoUkEY0Lj72z91XuXR7qUH+ZvlJitHb/ani IEZUAVkGw5sVOF9NcY5BoriSye5i11ze3khCL07a93OG8THd+rAk7BwigiX26sgth1QA9JVYeP2lc iCnE5zgmVCCL9OVmt9V/9XzNUT3bwQHHfXzcP7BdubaNofRyHZgy+x8P4NMLEhT9TprQIZIREVtdZ uzUaBoSWumRrDy1Gmjpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reer4-00000001zwI-2zTi; Mon, 26 Feb 2024 17:33:30 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reeqT-00000001zZ9-21w4 for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2024 17:32:56 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-787bc854a77so195666085a.3 for ; Mon, 26 Feb 2024 09:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708968770; x=1709573570; darn=lists.infradead.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=ZotKd2o47/oKAtdV1I26QivtjRepugTGHOJDDp/ZM4g=; b=XHvLVG5KcdLR++bTT70XlA07bxTFT7gb0mxQ1Vb+cZ5ql8IxJ/zGEgPdGWCGkP236T 7hhPrErA3TnK2B1r8K16clLIdDaBXdjldN27E/hk2Zl4B2kCJQUAjgW+jY2PPT/G08Vl HzIxD5lsn09/0dB6gD2xRp2TM1avVqsF9HT/E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708968770; x=1709573570; 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=ZotKd2o47/oKAtdV1I26QivtjRepugTGHOJDDp/ZM4g=; b=K1bCVk1hVsWqmJKD1rjrsuqkjY2M5/eTlkregpAZ56o+voCMHFWXJIfnLX2reqaQB0 Rz1VeKmXbXlR5Uw1edcyBkKyC9CmKoTxIKvoUgQNiAtlzBMARgGI6+7+yoPo/nO8NBA3 cFNv+zWbzcaACB6A76+HMbVXnxwKFDo4bEq0mVxgEmno3zlpHN+fyeX+hD1mrHUjiFk/ fdHfQKg/F19ByAxX9q6TuBKEM+cqXOJuwHfiPqI5N7+My9zGRg7tq4FtO3AtEFrrCVad vtZ7nBdsjoLVtat1dtPXjEQm4qPJx6PwUlGw7rVvYX1eavZHy0F2F/cKcAz1/gfPLxqt qW3Q== X-Forwarded-Encrypted: i=1; AJvYcCXpJfH48I8+AUyHPaDbq4Z2G8H19vTywQblE4UNF3I9w5VbayXAVmaHKGU3Gku70OPNRIsP87wHOm/3y3eEc5C+Nmj4TDE6S2WscwLqpNs5oz4WdMA= X-Gm-Message-State: AOJu0Yz0Q3oXlHK2VqR6aKTZLc0BUTspK7Fg+wH7QrrufnZOwEqk+uas D4JYEVC4IaStph9xcuh2ekkcsnF6s8mLVBDlFuOsLDUbVkJZIhGr0JLIFF4bhQ== X-Google-Smtp-Source: AGHT+IH3rAwgd0NXJq8G/TBWJ93nsJy2+AmuJ1+7I538QjgTdtVQQDhSqF/spxCAW7zvWaoaCpSjOA== X-Received: by 2002:a05:620a:9d7:b0:787:9a1c:fb32 with SMTP id y23-20020a05620a09d700b007879a1cfb32mr8021996qky.2.1708968769789; Mon, 26 Feb 2024 09:32:49 -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:49 -0800 (PST) From: Ricardo Ribalda Date: Mon, 26 Feb 2024 17:32:44 +0000 Subject: [PATCH v2 1/3] media: pci: sta2x11: Fix Wcast-function-type-strict warnings MIME-Version: 1.0 Message-Id: <20240226-fix-clang-warnings-v2-1-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_093253_577620_2FB88DFD X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Building with LLVM=1 throws the following warning: drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: warning: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Wcast-function-type-strict] Reviewed-by: Nathan Chancellor Signed-off-by: Ricardo Ribalda --- drivers/media/pci/sta2x11/sta2x11_vip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index e4cf9d63e926d..a6456673be3f6 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -757,7 +757,7 @@ static const struct video_device video_dev_template = { /** * vip_irq - interrupt routine * @irq: Number of interrupt ( not used, correct number is assumed ) - * @vip: local data structure containing all information + * @data: local data structure containing all information * * check for both frame interrupts set ( top and bottom ). * check FIFO overflow, but limit number of log messages after open. @@ -767,8 +767,9 @@ static const struct video_device video_dev_template = { * * IRQ_HANDLED, interrupt done. */ -static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) +static irqreturn_t vip_irq(int irq, void *data) { + struct sta2x11_vip *vip = data; unsigned int status; status = reg_read(vip, DVP_ITS); 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: 13572567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A11DC48BF6 for ; Mon, 26 Feb 2024 17:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=40IYYgxAP0YmxxJOk2upzfADlm5cQuI9a3W4I6+AkrQ=; b=WVDwD8dBjquvZL TntM+4n1abWMahqyYXTCn229tNUGk0E9bfxTkdMS5iY/a2KPlkXQoMPJ1UlkDfwwPKzY33QJbIggL owEGlMUXaYwDhKVQ1Hr5GZsZ7IL5wVYMBbQ4dTHt3L9hobyhoOlR0jX9A8PRT6m4soSAZ7WnKAgCQ lMt1PL+fQsajubF/nq3IEBjLhPPAGrJZ01kq5Vxt8G1MinJQv/bHjJ8+T/GN56Epaa5jW/AtbWetF mYsmtSBIMFQQz9OXyeGCaudjxe1vvNS0XCwVuc2geXGU5jtg9GtQnN4XrjDEgVvwefluvUksoaPyk NzBqD6PD5SNXGTxShIRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reeqb-00000001zhN-0Hk3; Mon, 26 Feb 2024 17:33:01 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reeqR-00000001za8-2xsr for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2024 17:32:54 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-787cb2ef657so94447785a.1 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=lists.infradead.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=jgjiVVac57E6m9n4l9K/glI7XCrxDni60Vy8+H9it16mQ701EoA8EHxgOSjdytSNCp 276RjlbpKfJhByiO+egQB7SVdzW1eYSYAt0Z9OpMR7h3LodlDZo7RZ2xepiKvck+cZEQ qAhe0vLOOutwMRF2tG/ez2SYLEMZf0uU1+8d4= 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=XH4+PKgtix0c1gurNR14tUWc1SQUW1TX/qNk7X2w+OLvyLsDw/Wzfl4Ku6XKBuPH22 QajAoIYuBGXPVFHg5RxZlYrB9dpoxz5iC+XBWJQw7I0D9kdgRZpz6qCUYI/7zUTxfWp1 nmNs0keFvyj0G14o552DJ0zdraEAKXgG8+VT+RqRAUspUc327lRefngkRPp3MVteKpKc c+VjCGwXSUGTelnS76Fx5aGcxKnwpxiHz9zWACMYS761/BzCSJCq7iBtNeXFIwXe1CUG Cz3udJKawYSfxPIUyQsw/Y964SG0PSaxh2hZF6JUQX9LOB9HhRdpojB1sxaD9kIBzhI8 ggvw== X-Forwarded-Encrypted: i=1; AJvYcCV4NlR1MDesg0HOFa9KPx4Uk6SID2dyuhs/BtFumCL3RUWSTXtnbQFmNpQ2gH/Sn1hydWHRFW1iEuFqa5wc3r23w+zGkEUYrNdr+YhHa2EYwOBy+tc= X-Gm-Message-State: AOJu0Yw1aI1jbITz6/qbWvCcLXmFyC+0ynw14C97JpyyZAJSvaH+1oiC 1+kjet+i92AwqtvcdgzFHKFsIg7DwlnyB+8HmHvequBrive6dc9RTcbKaB8klA== X-Google-Smtp-Source: AGHT+IFPFo6h6yoUZfpwUnRcJdbbOQwMO+GXxTDc9YEiO9pMJYeFAGXUAR4HJURnNZTsUOrD6721QA== 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_093251_965055_543EFFD9 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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); From patchwork Mon Feb 26 17:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13572569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AAF7C54E51 for ; Mon, 26 Feb 2024 17:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8qDE6ozm7dq4Fx2tSvLCSKa5vmx4EARgCAE3cbeVoxY=; b=a7Gn5MvNUUcIP8 X+0UzLIM8dNYmX6tCUP/VTprCndFmXUzuwarBXjz9l84ntBrH15XQu3d/5lDY2hPDtx9jfHdsnT+O zcL6NeP0enDACFAxsz6UuhdfCG6Ho7Al1xCovJrPIKTLP4AmnlTgrmP79ESwwo7PEcrARYI13cYaa uYf1+5cAxK9itKg8VOVvubvqbJVfMW4iIV6teD2PScctQEklcEeAsOxbHSXs/taHpx04pr1KskflC 0uBJagXhfvHa/zbE6KsbkoU6ucgmsz3b0Nl2jJnk5n1Z4T2tnZN+2SNn8IbVzEdMRSDB7N5v0yM2v aRtvIewxM3cmRUchYoXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reeqb-00000001zi7-3krK; Mon, 26 Feb 2024 17:33:01 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reeqS-00000001zbI-3P6J for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2024 17:32:55 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-787d021f08bso111201485a.3 for ; Mon, 26 Feb 2024 09:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708968772; x=1709573572; darn=lists.infradead.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=/didL5h/sYGHzQHALjvpk1UK+C5uX4ht1ERRn86zQ0I=; b=nveEwGMpRzFl/hyeG6+/vBq51B6nMdmvwvSEp0ct87/gWbN+3m9BUUgRFNHDYYpHBE A/0u09GUdpgcncJCBPCfjxKvJ9G8VnYEjg4ns9DFrCuuAgN+6kxrK76VIWwp8X8G+ryq 3KrxiO+aXlDzgeabXVHXiOVjva8MU4HZfiLwI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708968772; x=1709573572; 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=/didL5h/sYGHzQHALjvpk1UK+C5uX4ht1ERRn86zQ0I=; b=qVive4/gcM6OxGzY+vQxVt/XIGaoBb32OAGGQYfSdOu6bRUNKzSc6RxZVAS/lgzups sYGBeXoZR4d/zzoMJQGpX937ikQ7eHQ+TUxesdE3zKf/6hqA5Q1jM3sePZ2LN6tuj7la 1pumOxEOcJ4CrQhK+J0C74Yjvbvs5nAVvyQ698cNvVixm/asG1zQADbgofZqCcfPSll9 vMtaFrCK4qmSX6SLM48XMU9HIVVMSkQrgmoFnK7xmtFjkfUAPJ3YjwPnX4oHowfy/BJI Nf2HH4cJMdRpwxe8lvBnEKmVPEfqOVNv8kw4FZwyT125PVA89Cm/SGemtGF2qC59JOsB OWAg== X-Forwarded-Encrypted: i=1; AJvYcCUXjwF2onHnj0a+dcHBssmdtNO9F4XkYErW1Mcy+mk8mdkTPqZiUPFe/aAo5D9SSm9IwbuPDQmgLMVH9IoPk0pNqkBURqJcuOHl78Ov6diGNObHBzg= X-Gm-Message-State: AOJu0YzlcqT/2UWph1JGo1aMGt3DlfesJDtxszWoTFq3jsrbEMIdCIT4 KjezdA8/fYXpEBStxPCQ2BtKMZpbDqwK+AOeM5Nj4vLJknCdt1oVR5v+bFHVsQ== X-Google-Smtp-Source: AGHT+IFWEeHuCEfd782RZ+zP9OrwwL1TXNEPqp2q25xR25g7zYLNieWGKgAPjo8acbDElZv5ELPGvw== X-Received: by 2002:a05:620a:4092:b0:787:a0d2:460e with SMTP id f18-20020a05620a409200b00787a0d2460emr10758707qko.35.1708968772010; Mon, 26 Feb 2024 09:32:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:32:51 -0800 (PST) From: Ricardo Ribalda Date: Mon, 26 Feb 2024 17:32:46 +0000 Subject: [PATCH v2 3/3] media: mediatek: vcodedc: Fix Wcast-function-type-strict warnings MIME-Version: 1.0 Message-Id: <20240226-fix-clang-warnings-v2-3-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_093252_949432_D76300D1 X-CRM114-Status: GOOD ( 18.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Building with LLVM=1 throws the following warning: drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c:38:32: warning: cast from 'mtk_vcodec_ipi_handler' (aka 'void (*)(void *, unsigned int, void *)') to 'ipi_handler_t' (aka 'void (*)(const void *, unsigned int, void *)') converts to incompatible function type [-Wcast-function-type-strict] Constify the types to avoid the warning. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 12 ++++++------ .../media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h | 2 +- .../platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 10 +--------- drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 2 +- drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 2 +- drivers/remoteproc/mtk_scp.c | 4 ++-- include/linux/remoteproc/mtk_scp.h | 2 +- include/linux/rpmsg/mtk_rpmsg.h | 2 +- 8 files changed, 14 insertions(+), 22 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c index 49fc2e9d45dd5..c4f1c49b9d52a 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c @@ -77,10 +77,10 @@ void mdp_vpu_shared_mem_free(struct mdp_vpu_dev *vpu) dma_free_wc(dev, vpu->config_size, vpu->config, vpu->config_addr); } -static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len, +static void mdp_vpu_ipi_handle_init_ack(const void *data, unsigned int len, void *priv) { - struct mdp_ipi_init_msg *msg = (struct mdp_ipi_init_msg *)data; + const struct mdp_ipi_init_msg *msg = data; struct mdp_vpu_dev *vpu = (struct mdp_vpu_dev *)(unsigned long)msg->drv_data; @@ -91,10 +91,10 @@ static void mdp_vpu_ipi_handle_init_ack(void *data, unsigned int len, complete(&vpu->ipi_acked); } -static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len, +static void mdp_vpu_ipi_handle_deinit_ack(const void *data, unsigned int len, void *priv) { - struct mdp_ipi_deinit_msg *msg = (struct mdp_ipi_deinit_msg *)data; + const struct mdp_ipi_deinit_msg *msg = data; struct mdp_vpu_dev *vpu = (struct mdp_vpu_dev *)(unsigned long)msg->drv_data; @@ -102,10 +102,10 @@ static void mdp_vpu_ipi_handle_deinit_ack(void *data, unsigned int len, complete(&vpu->ipi_acked); } -static void mdp_vpu_ipi_handle_frame_ack(void *data, unsigned int len, +static void mdp_vpu_ipi_handle_frame_ack(const void *data, unsigned int len, void *priv) { - struct img_sw_addr *addr = (struct img_sw_addr *)data; + const struct img_sw_addr *addr = data; struct img_ipi_frameparam *param = (struct img_ipi_frameparam *)(unsigned long)addr->va; struct mdp_vpu_dev *vpu = diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h index 300363a40158c..2561b99c95871 100644 --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h @@ -23,7 +23,7 @@ enum mtk_vcodec_fw_use { struct mtk_vcodec_fw; -typedef void (*mtk_vcodec_ipi_handler) (void *data, +typedef void (*mtk_vcodec_ipi_handler) (const void *data, unsigned int len, void *priv); struct mtk_vcodec_fw *mtk_vcodec_fw_select(void *priv, enum mtk_vcodec_fw_type type, diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c index 9f6e4b59455da..4c34344dc7dcb 100644 --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c @@ -29,15 +29,7 @@ static int mtk_vcodec_vpu_set_ipi_register(struct mtk_vcodec_fw *fw, int id, mtk_vcodec_ipi_handler handler, const char *name, void *priv) { - /* - * The handler we receive takes a void * as its first argument. We - * cannot change this because it needs to be passed down to the rproc - * subsystem when SCP is used. VPU takes a const argument, which is - * more constrained, so the conversion below is safe. - */ - ipi_handler_t handler_const = (ipi_handler_t)handler; - - return vpu_ipi_register(fw->pdev, id, handler_const, name, priv); + return vpu_ipi_register(fw->pdev, id, handler, name, priv); } static int mtk_vcodec_vpu_ipi_send(struct mtk_vcodec_fw *fw, int id, void *buf, diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c index 82e57ae983d55..a840dd2a48d0e 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c @@ -97,7 +97,7 @@ static bool vpu_dec_check_ap_inst(struct mtk_vcodec_dec_dev *dec_dev, struct vde * This function runs in interrupt context and it means there's an IPI MSG * from VPU. */ -static void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv) +static void vpu_dec_ipi_handler(const void *data, unsigned int len, void *priv) { struct mtk_vcodec_dec_dev *dec_dev; const struct vdec_vpu_ipi_ack *msg = data; diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c index 84ad1cc6ad171..ea0c4a281d1a1 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c @@ -57,7 +57,7 @@ static bool vpu_enc_check_ap_inst(struct mtk_vcodec_enc_dev *enc_dev, struct ven return ret; } -static void vpu_enc_ipi_handler(void *data, unsigned int len, void *priv) +static void vpu_enc_ipi_handler(const void *data, unsigned int len, void *priv) { struct mtk_vcodec_enc_dev *enc_dev; const struct venc_vpu_ipi_msg_common *msg = data; diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index a35409eda0cf2..b508136b416a8 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -78,10 +78,10 @@ static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host) rproc_report_crash(scp_node->rproc, RPROC_WATCHDOG); } -static void scp_init_ipi_handler(void *data, unsigned int len, void *priv) +static void scp_init_ipi_handler(const void *data, unsigned int len, void *priv) { struct mtk_scp *scp = priv; - struct scp_run *run = data; + const struct scp_run *run = data; scp->run.signaled = run->signaled; strscpy(scp->run.fw_ver, run->fw_ver, SCP_FW_VER_LEN); diff --git a/include/linux/remoteproc/mtk_scp.h b/include/linux/remoteproc/mtk_scp.h index 7c2b7cc9fe6c1..84e579940b8e5 100644 --- a/include/linux/remoteproc/mtk_scp.h +++ b/include/linux/remoteproc/mtk_scp.h @@ -8,7 +8,7 @@ #include -typedef void (*scp_ipi_handler_t) (void *data, +typedef void (*scp_ipi_handler_t) (const void *data, unsigned int len, void *priv); struct mtk_scp; diff --git a/include/linux/rpmsg/mtk_rpmsg.h b/include/linux/rpmsg/mtk_rpmsg.h index 363b60178040b..9d67507471fba 100644 --- a/include/linux/rpmsg/mtk_rpmsg.h +++ b/include/linux/rpmsg/mtk_rpmsg.h @@ -9,7 +9,7 @@ #include #include -typedef void (*ipi_handler_t)(void *data, unsigned int len, void *priv); +typedef void (*ipi_handler_t)(const void *data, unsigned int len, void *priv); /* * struct mtk_rpmsg_info - IPI functions tied to the rpmsg device.