summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2017-06-15 13:31:53 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-20 08:53:40 -0300
commit4ba59616879217a7659a6cf343284aecb9a65ec2 (patch)
treecbb3c36f16f7ca9adc1d749d4192ed3305368649 /drivers/media/platform/qcom
parent2b2e6488c0a8d4b9b2e20d117228925b80dbc24b (diff)
[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: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/qcom')
-rw-r--r--drivers/media/platform/qcom/venus/helpers.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index f777ef80b941..5f4434c0a8f1 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -150,14 +150,12 @@ static int intbufs_free(struct venus_inst *inst)
static u32 load_per_instance(struct venus_inst *inst)
{
- u32 w = inst->width;
- u32 h = inst->height;
u32 mbs;
if (!inst || !(inst->state >= INST_INIT && inst->state < INST_STOP))
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;
}