Skip to content

Commit

Permalink
media: venus: venus_helper_get_bufreq(): req is never NULL
Browse files Browse the repository at this point in the history
Fix a smatch error:

drivers/media/platform/qcom/venus/helpers.c: drivers/media/platform/qcom/venus/helpers.c:678 venus_helper_get_bufreq() error: we previously assumed 'req' could be null (see line 674)

After checking how venus_helper_get_bufreq() is called it is clear that
req is never NULL, so just drop the checks.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 15, 2022
1 parent 109670d commit b4d1d5c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/media/platform/qcom/venus/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
unsigned int i;
int ret;

if (req)
memset(req, 0, sizeof(*req));
memset(req, 0, sizeof(*req));

if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2)
req->count_min = inst->fw_min_cnt;
Expand All @@ -694,8 +693,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
if (hprop.bufreq[i].type != type)
continue;

if (req)
memcpy(req, &hprop.bufreq[i], sizeof(*req));
memcpy(req, &hprop.bufreq[i], sizeof(*req));
ret = 0;
break;
}
Expand Down

0 comments on commit b4d1d5c

Please sign in to comment.