]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: mtk-vcodec: venc: avoid -Wenum-compare-conditional warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 8 Sep 2025 21:43:58 +0000 (17:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:35:35 +0000 (13:35 +0200)
[ Upstream commit 07df4f23ef3ffe6fee697cd2e03623ad27108843 ]

This is one of three clang warnings about incompatible enum types
in a conditional expression:

drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c:597:29: error: conditional expression between different enumeration types ('enum scp_ipi_id' and 'enum ipi_id') [-Werror,-Wenum-compare-conditional]
  597 |         inst->vpu_inst.id = is_ext ? SCP_IPI_VENC_H264 : IPI_VENC_H264;
      |                                    ^ ~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~

The code is correct, so just rework it to avoid the warning.

Fixes: 0dc4b3286125 ("media: mtk-vcodec: venc: support SCP firmware")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@google.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[ Adapted file path ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c

index d0123dfc5f93d150d7ad4f785b9777a72234fe18..ea305f6f49ed35fff95a8b62d2a2a65ac9e5ecf8 100644 (file)
@@ -509,7 +509,11 @@ static int h264_enc_init(struct mtk_vcodec_ctx *ctx)
 
        inst->ctx = ctx;
        inst->vpu_inst.ctx = ctx;
-       inst->vpu_inst.id = is_ext ? SCP_IPI_VENC_H264 : IPI_VENC_H264;
+       if (is_ext)
+               inst->vpu_inst.id = SCP_IPI_VENC_H264;
+       else
+               inst->vpu_inst.id = IPI_VENC_H264;
+
        inst->hw_base = mtk_vcodec_get_reg_addr(inst->ctx, VENC_SYS);
 
        mtk_vcodec_debug_enter(inst);