Skip to content

Commit f508fc3

Browse files
arndbgregkh
authored andcommitted
media: mtk-vcodec: venc: avoid -Wenum-compare-conditional warning
[ Upstream commit 07df4f2 ] 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: 0dc4b32 ("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> [ Adjust file paths ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 69dd5bb commit f508fc3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/media/platform/mediatek/vcodec/venc/venc_h264_if.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,11 @@ static int h264_enc_init(struct mtk_vcodec_ctx *ctx)
611611

612612
inst->ctx = ctx;
613613
inst->vpu_inst.ctx = ctx;
614-
inst->vpu_inst.id = is_ext ? SCP_IPI_VENC_H264 : IPI_VENC_H264;
614+
if (is_ext)
615+
inst->vpu_inst.id = SCP_IPI_VENC_H264;
616+
else
617+
inst->vpu_inst.id = IPI_VENC_H264;
618+
615619
inst->hw_base = mtk_vcodec_get_reg_addr(inst->ctx, VENC_SYS);
616620

617621
mtk_vcodec_debug_enter(inst);

0 commit comments

Comments
 (0)