Commit 4ba59616 authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

[media] media: venus: helpers: fix variable dereferenced before check

This fixes a warning found when building the driver with gcc7:

drivers/media/platform/qcom/venus/helpers.c:157
load_per_instance() warn: variable dereferenced before check
'inst' (see line 153)
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 2b2e6488
...@@ -150,14 +150,12 @@ static int intbufs_free(struct venus_inst *inst) ...@@ -150,14 +150,12 @@ static int intbufs_free(struct venus_inst *inst)
static u32 load_per_instance(struct venus_inst *inst) static u32 load_per_instance(struct venus_inst *inst)
{ {
u32 w = inst->width;
u32 h = inst->height;
u32 mbs; u32 mbs;
if (!inst || !(inst->state >= INST_INIT && inst->state < INST_STOP)) if (!inst || !(inst->state >= INST_INIT && inst->state < INST_STOP))
return 0; return 0;
mbs = (ALIGN(w, 16) / 16) * (ALIGN(h, 16) / 16); mbs = (ALIGN(inst->width, 16) / 16) * (ALIGN(inst->height, 16) / 16);
return mbs * inst->fps; return mbs * inst->fps;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment