lkml.org 
[lkml]   [2024]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 3/3] media: mediatek: vcodedc: Fix Wcast-function-type-strict warnings
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]

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

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 9f6e4b59455d..781a0359afdc 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
@@ -33,9 +33,11 @@ static int mtk_vcodec_vpu_set_ipi_register(struct mtk_vcodec_fw *fw, int id,
* 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.
+ * more constrained, so the conversion below is safe. We use the void
+ * casting, to convince clang with -Wcast-function-type-sctrict that
+ * this is safe.
*/
- ipi_handler_t handler_const = (ipi_handler_t)handler;
+ ipi_handler_t handler_const = (ipi_handler_t)((void *)handler);

return vpu_ipi_register(fw->pdev, id, handler_const, name, priv);
}
--
2.43.0.429.g432eaa2c6b-goog


\
 
 \ /
  Last update: 2024-05-27 14:37    [W:0.212 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site