Skip to content

Commit

Permalink
[media] media: venus: helpers: fix variable dereferenced before check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanimir Varbanov authored and Mauro Carvalho Chehab committed Jun 20, 2017
1 parent 2b2e648 commit 4ba5961
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/platform/qcom/venus/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4ba5961

Please sign in to comment.