Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2521728lqp; Mon, 25 Mar 2024 01:00:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWiFG9RTcUdkYXDu5gyw0JjTh9gT2lv1gHhR5AA5TElg6wshnOYOc0uVZjFKDoXzgwPh0ZQNNbZVgNTVXuIvtyE3fgjqlV+NmE2V9lpeA== X-Google-Smtp-Source: AGHT+IF9in9LFp/A6cGXb3R9anLassnpbaG35iusR4804bMK6PbKIGTQIfVSqQcaKx0CcE3sJdze X-Received: by 2002:a05:622a:302:b0:431:5cf6:ba35 with SMTP id q2-20020a05622a030200b004315cf6ba35mr1198033qtw.22.1711353609521; Mon, 25 Mar 2024 01:00:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711353609; cv=pass; d=google.com; s=arc-20160816; b=yOBI9ulxiwNv5kwbf/8jzd6gygAndCGmiSP4pCGRN+X6zyuVMLccIBxB19RbCwDl4c CwS/I3JDadn8pWQ6UaXOFsQPlyi0yHk9OqBuynnGKFK1tc01XEd1d1jE42HSIYBxZIrl gbHOoO3tYSmkmW/CXoVLfV4bQJkCkavCQunY0nFWR1gC+9rnuE59pjhvW2XGAcyhsAWq t9dVV5Tds6FbbjbLt/mAkSAmstThOUxebj7VPXH2VOsiaUK8WptZZAplOZ9D3ckR2Rik dL00GI6qQQJ8wBYL/pRWgl3RErCo+wftLtD7h0lS7D1oYZ46tA9k2aVAeWyTYzAFYMeI 7p1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=v2BHmH5Bp15pmMcS9QT5pu5jN2pFr6xxLkwyAHVSGmI=; fh=Kcah/Kc5DsXfZd8tAiYOKrkxlDhWLImjILUZX91Fk3Y=; b=YB7cBft0QoP5ljCRWo+zmqSzcmce1ZfQMRhVQKLDgvvzB93PbFEzlDQzjA28e/XRrs poa3jmdYSiqSDxn5lluAmNQEHa8ePcj+6AyvVg5N5L9/kPBxKEyyIuKWjm7MMiTqpiau HVfAeDLA+No7Kvh5UTHKOVCccx+EiafZIXu+VWKKfHWGK0ny+J8vuh/x9yvRr99yD5XP 3r3fh5UkzuVeSajy3bXha+HK7A9dlGBQjW4fkngDRyICWrwPOAeWP/RTegKFad271JQX 282YAaPx/JtimCLdmBdWlUxERk3boGhkp1ikO5OO7i33eVX83/s4t14Yr+l8qmgYPhP2 m0vA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T0/swgzn"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115709-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cj18-20020a05622a259200b00430bb4b5f04si4956703qtb.776.2024.03.25.01.00.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115709-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b="T0/swgzn"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115709-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 424D21C2F2C4 for ; Mon, 25 Mar 2024 08:00:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17A971EC4A1; Mon, 25 Mar 2024 02:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T0/swgzn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 297A2214849; Sun, 24 Mar 2024 23:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321739; cv=none; b=miwCmPu205QL5+uXBG1j0vji4zOgEuTnmX8KWdBY0LTPLc0qKikOceZjtjEr1SNzUuuiI+S99I7Ju268ufNfuUwsVBaXbQO6hv0E1VAg9LS6Rd0+1+DM+SidGR3eAmboXJmUV06N5ltuJZ92B+yUgjR8I2h61zeQbY1LvbY373Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321739; c=relaxed/simple; bh=ZImlfLx5LP+b1B5p0xTZ5FuzC/pPyNOKVABol0VrAbc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nqE+RsLKh5HaI7cl1g+VGqgeb8Ai4pKwFSkBrezQ5Ki274f4SmSsXNWoa7slXc02aK0AaSeAYbs7MJYB1+FA7a+PVqurKAUOa+JvrdOYhI5A5kq06JLkeeHO/ylnFqBXo1ZCqo3a3/HeQ6OtBO8GFGbDenROvcZlZ9+IQ6cPbUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T0/swgzn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 547F7C43390; Sun, 24 Mar 2024 23:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321738; bh=ZImlfLx5LP+b1B5p0xTZ5FuzC/pPyNOKVABol0VrAbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0/swgznZU+2gNvgW3Cxq0wNOK1zGP19GLXRjcOAysCIlmHkzx45jidtL0OqMBmdK NdaXgPafUks7PjixfhZhYNvgMMWRBE5s2z0ZpFSUDBzibSoj47tbRIm2BV5pyjckjd auX44otWh1gZbKMmkJI67WSEIjvetZI6B070sHuz/UNm7owrBwd5SwWxU1pxZbiw7u JptANArFKnb8JlXJ+qXzsEFOU00z0Ia8VGiPN0C03Qq6DyuuKTwrT06wbgJG/8SjK5 AcWEp5ErB1NFT0eY+EfvKLkHp/TIcKXd/IJieUyZVzgLVcBHlWiN3LhzEtRbh1RKES KQkJkNVT4flCQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , Ricardo Ribalda , Hans Verkuil , Sasha Levin Subject: [PATCH 6.6 466/638] media: mediatek: vcodec: avoid -Wcast-function-type-strict warning Date: Sun, 24 Mar 2024 18:58:23 -0400 Message-ID: <20240324230116.1348576-467-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324230116.1348576-1-sashal@kernel.org> References: <20240324230116.1348576-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Arnd Bergmann [ Upstream commit bfb1b99802ef16045402deb855c197591dc78886 ] The ipi handler here tries hard to maintain const-ness of its argument, but by doing that causes a warning about function type casts: drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c:38:32: error: 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 [-Werror,-Wcast-function-type-strict] 38 | ipi_handler_t handler_const = (ipi_handler_t)handler; | ^~~~~~~~~~~~~~~~~~~~~~ Remove the hack and just use a non-const argument. Fixes: bf1d556ad4e0 ("media: mtk-vcodec: abstract firmware interface") Signed-off-by: Arnd Bergmann Reviewed-by: Ricardo Ribalda Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c | 2 +- .../mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 10 +--------- drivers/media/platform/mediatek/vpu/mtk_vpu.c | 2 +- drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c index b065ccd069140..378a1cba0144f 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c @@ -26,7 +26,7 @@ static void mtk_mdp_vpu_handle_init_ack(const struct mdp_ipi_comm_ack *msg) vpu->inst_addr = msg->vpu_inst_addr; } -static void mtk_mdp_vpu_ipi_handler(const void *data, unsigned int len, +static void mtk_mdp_vpu_ipi_handler(void *data, unsigned int len, void *priv) { const struct mdp_ipi_comm_ack *msg = data; 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 5e03b08865599..0849ffb0dcd45 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/vpu/mtk_vpu.c b/drivers/media/platform/mediatek/vpu/mtk_vpu.c index 7243604a82a5b..724ae7c2ab3ba 100644 --- a/drivers/media/platform/mediatek/vpu/mtk_vpu.c +++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.c @@ -635,7 +635,7 @@ int vpu_load_firmware(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(vpu_load_firmware); -static void vpu_init_ipi_handler(const void *data, unsigned int len, void *priv) +static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv) { struct mtk_vpu *vpu = priv; const struct vpu_run *run = data; diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.h b/drivers/media/platform/mediatek/vpu/mtk_vpu.h index a56053ff135af..da05f3e740810 100644 --- a/drivers/media/platform/mediatek/vpu/mtk_vpu.h +++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.h @@ -17,7 +17,7 @@ * VPU interfaces with other blocks by share memory and interrupt. */ -typedef void (*ipi_handler_t) (const void *data, +typedef void (*ipi_handler_t) (void *data, unsigned int len, void *priv); -- 2.43.0