]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: mediatek: vcodec: avoid -Wcast-function-type-strict warning
authorArnd Bergmann <arnd@arndb.de>
Sat, 24 Feb 2024 12:10:22 +0000 (13:10 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:53 +0000 (18:19 -0400)
commit7334b815d2029764cefb2cac84afe3916369d1db
tree7aa66f1cf7e4a7800288d7078b91e35c434bf8f5
parent7393c681f9aa05ffe2385e8716989565eed2fe06
media: mediatek: vcodec: avoid -Wcast-function-type-strict warning

[ 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 <arnd@arndb.de>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mediatek/mdp/mtk_mdp_vpu.c
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c
drivers/media/platform/mediatek/vpu/mtk_vpu.c
drivers/media/platform/mediatek/vpu/mtk_vpu.h