Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2397550lqp; Sun, 24 Mar 2024 17:44:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpHt59meSdDZLFnVKZlHb0qLLCCd+N1a6splkJIMDKyBaanieuHwVYBu49aaSmgOwQNIvTs1N49IBD3YG91TQPMBhB2FIl7pvhif7vIg== X-Google-Smtp-Source: AGHT+IGvvd5Fy1m4VedRdfV4w4vfhSlsfjkAWzB0ODfyGmsHsHKMdyltTWq/NgA0gsnyp/OFOHFG X-Received: by 2002:a50:d65c:0:b0:56c:d47:e403 with SMTP id c28-20020a50d65c000000b0056c0d47e403mr1101456edj.28.1711327467692; Sun, 24 Mar 2024 17:44:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327467; cv=pass; d=google.com; s=arc-20160816; b=WrIWm7ulY+RpX9redF6iiqhbNgKuvrwXcfWCXnX7i8kHKchkG5BDHKSUztwUO3MTd5 o/m+6Ryjz8EtRAdEZmgZKaCuUhmiJKWYrasDcblXD5h3o5SvFzTGDP31Ql6OCREge1AW 7ag9r4DpWC+mvph2S/6OyAnIcgb0oQalwB2JGCkYj37DMwPzCRQel2FxOhvSq8kzhW04 A0gzx6QOOjC9Y+7an4CG/5ZIl0ZGxFGLciXYgu76ZnSfbap44ZbYAEmRnz1yqoCq7pvI Y06u3ZmL9tyyjx5cRs5taat9O17F1v5OKkKLtlHfzVIr2yx6vLbD7e9Q7BlYT1MuPS92 O4Bw== 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=ri0sGXg2dbE3sjc2nd5c+MU3KjtETeL8D0HTqXxAMaU=; fh=Kcah/Kc5DsXfZd8tAiYOKrkxlDhWLImjILUZX91Fk3Y=; b=AHGJ/ekHArLQ50/luXMHR6Jq3w+SCA3qBPf3+rM8yN6vgJsFGchYvOQ132C5DSmmc4 d8qDs/VNjB1jv+wJddd3326sMNEjB+uHJgB8ERNBsACgbYYNWSy0IkwZYiG8lVhciPzz tSKDkeqWUpmcCqFXHNYL1+H/wjLobZUrt4gyk0tS/E0h+QpoCUpL348idRlP8MaBz3q3 jqq7dYslkTm/4u+6QmZzN/E7mYtG8AqkfbnDgdA7O5mQ8UfebK+tgasEcuXHrDjDH6iR m1ejSKFHbrQJri2TY/7ej9QHXwkej9/nXFZW4Oyyyxa3yaX8zjwzl1va3TPcVnt6fWae tDRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H7PJuW96; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113384-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t1-20020a508d41000000b0056b82a4a517si2016866edt.429.2024.03.24.17.44.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H7PJuW96; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113384-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 58E881F27ABA for ; Mon, 25 Mar 2024 00:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A60D91A03CA; Sun, 24 Mar 2024 22:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H7PJuW96" 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 B56211A0B0A; Sun, 24 Mar 2024 22:43:05 +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=1711320185; cv=none; b=R0NN/ZRMtkZCWduassWT5YNucpxjdM7BKBK/izXE+iJoyRZx7OqfyHEnk4J2yEKiDpgGm3SDt6wisNQd/nGS6Zhqh4tcYjJ0/xUkgVtHSsfahqfv9D02/wPRcMJP1eo+xcaL906AWO9U8ajV/RdRulZm80kmVt96AGcCOc8RLvg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320185; c=relaxed/simple; bh=S8kbZG+dRKcv3OEWd9mM3vMaqdUCQsDUNZLrWHaOi5Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j04S7IldtcriMMh180d09D9/nPgkyVt84IMj7of52jhm4EiqxOyuQAC8Z2ua/2ZYLv4hol533BSxai01nwoKQ//Az5Uyme53c3K/No4Tw8GINDdYUE28Vuc8UGhKFGcNEaYxL6lpZOWugONic9MVWZnGuQ2A3EVmW7LolDwB1rk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H7PJuW96; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92135C433C7; Sun, 24 Mar 2024 22:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320185; bh=S8kbZG+dRKcv3OEWd9mM3vMaqdUCQsDUNZLrWHaOi5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H7PJuW960o15T++AEsgXMI9Srd4Zlbdvu/Q2XHd58s9IUo9+bd1jJELcXrnL3YY3r PZsvJ/+P3qfQTC2g2Lrno9kfx/4UIs4ljukaGAuxcOrV5or3lDwi2dwx03PyllkhwR llbzar7+468g6Y+FmJwMDwiwZGDdwB/wBuk0D/d0lu0n7LQYOyMxjYwXAouCbtPET6 H2t3sENTzWVQm9fWi3tzV0VKYQRk7lksGEihs+ST7UgDKY/0YlTKbRJsfHU0aHC1jr lH69fiffj0t6Qb5yw6yZqHbdGeEUYVzAsSC2aGX7KRKa8bQgxnXBoPS8bylxgRr5aM Wjz0KCDhxMvBg== 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.8 493/715] media: mediatek: vcodec: avoid -Wcast-function-type-strict warning Date: Sun, 24 Mar 2024 18:31:12 -0400 Message-ID: <20240324223455.1342824-494-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 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/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