Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2490484lqp; Sun, 24 Mar 2024 23:19:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxAKcxDJgLW7BbT81LvAhwIuhPekdfN1TwxntB88KtaRTbGs3ue3uJfoAOZSctQpNr/iSyWcLre+9bkLIlOuJneDY3UChrP40clMvHVg== X-Google-Smtp-Source: AGHT+IHHvhpbuxvJHSAMeQuB77W5w1RscP+AsQJhi/0eTHR9CnwngwbHs3hr/OoufuEwq4rPlBGp X-Received: by 2002:a05:620a:24c2:b0:78a:3ad8:5487 with SMTP id m2-20020a05620a24c200b0078a3ad85487mr8373648qkn.45.1711347570614; Sun, 24 Mar 2024 23:19:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711347570; cv=pass; d=google.com; s=arc-20160816; b=TWyzmRUKHj56YKJ4jjv7Ug/77AHor+jN/x0MJHmMoAVQ0XxC/R2nCbxcO4IIgAmyJB n6ihWaMk1zdutHXPffsOHwXYZE9d+9YyPiuOqNWAZ7a24ea/4OUHbGJOGyJ1B2ObObTS rDgKg69CGqauSH/G6B8WTIOkyYlhv45M8aYJJterG8JnisYSTHlIObxc1tzOycj9jiee vMujgSQ92yXvwcND2oz3RtUOV/iJgRHJWTO0KhVrk+AnZrCpjxc1I+OZniNrV5BNyB6J gvpckXuUMIzK7/heMjLFyeSwAphEwx6yN19IxqYRkuoIdfnJxJ0him5bTIKDEvo+Bb7+ GpxA== 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=bM0XT+ynffFhx6V2ZPM5e/k6rdcj1ZiFt6lrQbLbuxU=; fh=Kcah/Kc5DsXfZd8tAiYOKrkxlDhWLImjILUZX91Fk3Y=; b=jkwPUFmqfKqUNLT0urt6E/BZjv32xChQt+wFl6t9KaNava+aczPsRfeQ873bKh+IzN vdaUDtg///dJKWx7QAGdNzTmsTsYARU+PgPesKJdsdmO68f17a6KoHqDZ8Str+SWiWQq AJSbu2gjGOYiGAZrL2SIhzlc6V/ZyS/vKxlXSEboF8KY7Y2LpaU9n7SMXboUTHXjytpp zIEPWVO6XNUpZEpkoXxjtdNE3jLP7ECCWvxzdgSEGY4miurRVbE695ZUtqG15SJllQHd yt22Ygg+Z46uFQ5WgKcIrIfWvOgiS/c2mJVxhhJw/D3ID5RdjIJCqQStCeRHPHAUpW7c QNIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mWIccTTK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114596-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a5-20020a05620a124500b0078908ec89c2si4675331qkl.367.2024.03.24.23.19.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 23:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-114596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mWIccTTK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114596-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 472581C2C38D for ; Mon, 25 Mar 2024 06:19:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE76929EA29; Sun, 24 Mar 2024 23:54:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mWIccTTK" 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 AD15E2319D1; Sun, 24 Mar 2024 23:17:26 +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=1711322246; cv=none; b=XB2RxsosP4qXCej7HtEmInv9kFeD3qiwgwDBLZ3OUeFrTF1RSRNejQMTfCaFwx2zBnO0pzMpzQ8wEJnj1bGj0OMiPiqlWsi+z1WWU9EcXQUZVGBlI3bDlDqg+qX++0wmDN9ifNfvf985qx2SxMos0tRTWqpc/pUVqGaftqvk+7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322246; c=relaxed/simple; bh=YtYiq5GpkNDYw/3R6avHKberyyK40I1p4rx7Jvggyfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FV05WjtG8iYn2GY2ySdBegg4OR6e9HnH2gxVGOeZkmrHXp6A0gENkaaPffyQ8OWrQ/jEwiIpDQ6LC5EpCnIVcnSggwIu7QOYBS0mvHiYX5UKRtL+LV6sUf33dfFU1BWP29bLr+8mrfiU+hjQeYI3imC9D1gun6bIJwQFuI6bGIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mWIccTTK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D47AAC43399; Sun, 24 Mar 2024 23:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322246; bh=YtYiq5GpkNDYw/3R6avHKberyyK40I1p4rx7Jvggyfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWIccTTKLXr9N6EzegUL88QAG7ldy+d1jKbImVEXimq0m/VRwnlo9T9lVMzG2qgrg NK1lCXNvR/x00ovASlN+4keAtoMaoJw5D6iNYlvdrULuS3wwQi2bLWqyUpoMs3kY2x 59Wx1fwBUq3T4bnRsFqL9tzn3NpTS2wqQMjWzlYA/C8f18vihW02RVyDw8KVMi5j6g Bv/pB+MncB4cIXzILui0l0fpQIRn6xVD13n7naW8srZtFBQZnTzPdSSvroID97v2uP 294PdR6yyKOu9dGCY8/ibWviwIMZu6Go7DHX/lNKelSFuWK9pIaalrNjHHmeWxhonH 6GDEnAyCOlmCA== 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.1 328/451] media: mediatek: vcodec: avoid -Wcast-function-type-strict warning Date: Sun, 24 Mar 2024 19:10:04 -0400 Message-ID: <20240324231207.1351418-329-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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 +- .../media/platform/mediatek/vcodec/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/mtk_vcodec_fw_vpu.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c index cfc7ebed8fb7a..1ec29f1b163a1 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c +++ b/drivers/media/platform/mediatek/vcodec/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 6beab9e86a22a..44adf5cfc9bb2 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