From 48768a97c3cd13c349b9403cdcaa8d81ca8c6887 Mon Sep 17 00:00:00 2001 From: "xinguang.jiang" Date: Wed, 6 Jan 2021 20:37:40 +0800 Subject: [PATCH] vdec: fix coverity issues [1/1] PD#SWPL-19875 Problem: There are some coverity scanned issues Solution: Fix the coverity issues Verify: S905X4-AH212 Change-Id: I215a1d1e2350a822c4ac8e11fcdcd122bb43fc49 Signed-off-by: xinguang.jiang --- drivers/amvdec_ports/aml_vcodec_dec.c | 20 +++++++++---------- .../decoder/h264_multi/h264_dpb.c | 4 ++-- .../decoder/mjpeg/vmjpeg_multi.c | 2 +- .../decoder/mpeg12/vmpeg12_multi.c | 4 ++-- .../decoder/mpeg4/vmpeg4_multi.c | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index 07f1cc8..790c718 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -362,26 +362,26 @@ void vdec_frame_buffer_release(void *data) if (aml_check_inst_quit(dev, inst, id)) { struct vframe_s *vf = &priv_data->vf; + v4l_dbg(0, V4L_DEBUG_CODEC_BUFMGR, + "[%d]: vf idx: %d, bmmu idx: %d, bmmu_box: %lx\n", + id, vf->index, vf->mm_box.bmmu_idx, + (ulong) vf->mm_box.bmmu_box); + + v4l_dbg(0, V4L_DEBUG_CODEC_BUFMGR, + "[%d]: vf idx: %d, mmu_idx: %d, mmu_box: %lx\n", + id, vf->index, vf->mm_box.mmu_idx, + (ulong) vf->mm_box.mmu_box); + if (decoder_bmmu_box_valide_check(vf->mm_box.bmmu_box)) { decoder_bmmu_box_free_idx(vf->mm_box.bmmu_box, vf->mm_box.bmmu_idx); decoder_bmmu_try_to_release_box(vf->mm_box.bmmu_box); - } else { - v4l_dbg(0, V4L_DEBUG_CODEC_BUFMGR, - "[%d]: vf idx: %d, bmmu idx: %d, bmmu_box: %lx\n", - id, vf->index, vf->mm_box.bmmu_idx, - (ulong) vf->mm_box.bmmu_box); } if (decoder_mmu_box_valide_check(vf->mm_box.mmu_box)) { decoder_mmu_box_free_idx(vf->mm_box.mmu_box, vf->mm_box.mmu_idx); decoder_mmu_try_to_release_box(vf->mm_box.mmu_box); - } else { - v4l_dbg(0, V4L_DEBUG_CODEC_BUFMGR, - "[%d]: vf idx: %d, mmu_idx: %d, mmu_box: %lx\n", - id, vf->index, vf->mm_box.mmu_idx, - (ulong) vf->mm_box.mmu_box); } } diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c index 05903c4..6cf05bd 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c @@ -5058,8 +5058,8 @@ static void reorder_short_term(struct Slice *currSlice, int cur_list, } dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL, - "%s: RefPicListX[ %d ] = pic %lx (%d)\n", __func__, - *refIdxLX, (ulong)picLX, picNumLX); + "%s: RefPicListX[ %d ] = pic %px (%d)\n", __func__, + *refIdxLX, picLX, picNumLX); RefPicListX[(*refIdxLX)++] = picLX; diff --git a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c index 31d1ab2..947a8b5 100644 --- a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c +++ b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c @@ -1006,7 +1006,7 @@ static int vmjpeg_v4l_alloc_buff_config_canvas(struct vdec_mjpeg_hw_s *hw, int i } mmjpeg_debug_print(DECODE_ID(hw), PRINT_FLAG_V4L_DETAIL, - "[%d] v4l ref buf addr: 0x%lx\n", ctx->id, (ulong)fb); + "[%d] v4l ref buf addr: 0x%px\n", ctx->id, fb); if (vdec->parallel_dec == 1) { if (hw->buffer_spec[i].y_canvas_index == -1) diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index 03ee58b..c258cb4 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -476,8 +476,8 @@ static int vmpeg12_v4l_alloc_buff_config_canvas(struct vdec_mpeg12_hw_s *hw, int fb->m.mem[1].bytes_used = decbuf_uv_size; } - debug_print(DECODE_ID(hw), 0, "[%d] %s(), v4l ref buf addr: 0x%lx\n", - ctx->id, __func__, (ulong)fb); + debug_print(DECODE_ID(hw), 0, "[%d] %s(), v4l ref buf addr: 0x%px\n", + ctx->id, __func__, fb); if (vdec->parallel_dec == 1) { u32 tmp; diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c index 7c90fdf..65111c2 100644 --- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c +++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c @@ -432,8 +432,8 @@ static int vmpeg4_v4l_alloc_buff_config_canvas(struct vdec_mpeg4_hw_s *hw, int i fb->m.mem[1].bytes_used = decbuf_uv_size; } - mmpeg4_debug_print(DECODE_ID(hw), 0, "[%d] %s(), v4l ref buf addr: 0x%lx\n", - ((struct aml_vcodec_ctx *)(hw->v4l2_ctx))->id, __func__, (ulong)fb); + mmpeg4_debug_print(DECODE_ID(hw), 0, "[%d] %s(), v4l ref buf addr: 0x%px\n", + ctx->id, __func__, fb); if (vdec->parallel_dec == 1) { u32 tmp; @@ -2177,8 +2177,8 @@ static void vmpeg4_local_init(struct vdec_mpeg4_hw_s *hw) hw->unstable_pts = (((unsigned long) hw->vmpeg4_amstream_dec_info.param & 0x40) >> 6); mmpeg4_debug_print(DECODE_ID(hw), 0, - "param = 0x%lx unstable_pts = %d\n", - (ulong)hw->vmpeg4_amstream_dec_info.param, + "param = 0x%px unstable_pts = %d\n", + hw->vmpeg4_amstream_dec_info.param, hw->unstable_pts); hw->last_dec_pts = -1; -- 2.20.1