From 9eeb0ed0f30938f31a3d9135a88b9502192c18dd Mon Sep 17 00:00:00 2001 From: Minghsiu Tsai Date: Wed, 8 Feb 2017 00:09:51 -0200 Subject: [media] mtk-vcodec: fix build warnings without DEBUG After removing DEBUG from mtk_vcodec_util.h, some build warnings are generated as the following: .../drivers/media/platform/mtk-vcodec/vdec_vpu_if.c: In function 'vcodec_vpu_send_msg': .../drivers/media/platform/mtk-vcodec/vdec_vpu_if.c:73:11: warning: unused variable 'msg_id' [-Wunused-variable] uint32_t msg_id = *(uint32_t *)msg; ^ .../drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c: In function 'vb2ops_vdec_buf_queue': .../drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:1129:7: warning: unused variable 'log_level' [-Wunused-variable] int log_level = ret ? 0 : 1; ^ .../drivers/media/platform/mtk-vcodec/venc_vpu_if.c: In function 'vpu_enc_send_msg': .../drivers/media/platform/mtk-vcodec/venc_vpu_if.c:82:12: warning: unused variable 'msg_id' [-Wunused-variable] uint32_t msg_id = *(uint32_t *)msg; ^ It is because mtk_vcodec_debug() and mtk_vcodec_err() are defined as empty macros. Without DEBUG definition, the variable for debugging is not used anymore. Fixing build warnings by moving the assignment of the variable to the argument of mtk_vcodec_debug() and mtk_vcodec_err(). Within the patch, build pass with/without DEBUG definition, and functions still work fine. Signed-off-by: Minghsiu Tsai Reviewed-by: Daniel Kurtz Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/media/platform/mtk-vcodec/vdec_vpu_if.c') diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c index 5a24c51aebb7..1abd14e79565 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c @@ -70,9 +70,8 @@ void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv) static int vcodec_vpu_send_msg(struct vdec_vpu_inst *vpu, void *msg, int len) { int err; - uint32_t msg_id = *(uint32_t *)msg; - mtk_vcodec_debug(vpu, "id=%X", msg_id); + mtk_vcodec_debug(vpu, "id=%X", *(uint32_t *)msg); vpu->failure = 0; vpu->signaled = 0; @@ -80,7 +79,7 @@ static int vcodec_vpu_send_msg(struct vdec_vpu_inst *vpu, void *msg, int len) err = vpu_ipi_send(vpu->dev, vpu->id, msg, len); if (err) { mtk_vcodec_err(vpu, "send fail vpu_id=%d msg_id=%X status=%d", - vpu->id, msg_id, err); + vpu->id, *(uint32_t *)msg, err); return err; } -- cgit