Commit 352ff3f3 authored by Xu Wang's avatar Xu Wang Committed by Mauro Carvalho Chehab

media: atomisp: Remove unneeded null check

In ia_css_frame_map, the check of 'err' is unneeded to be done twice.

Link: https://lore.kernel.org/linux-media/20211110094910.67951-1-vulab@iscas.ac.cnSigned-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent b467d97f
...@@ -168,25 +168,23 @@ int ia_css_frame_map(struct ia_css_frame **frame, ...@@ -168,25 +168,23 @@ int ia_css_frame_map(struct ia_css_frame **frame,
if (err) if (err)
return err; return err;
if (!err) { if (pgnr < ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
if (pgnr < ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) { dev_err(atomisp_dev,
dev_err(atomisp_dev, "user space memory size is less than the expected size..\n");
"user space memory size is less than the expected size..\n"); err = -ENOMEM;
err = -ENOMEM; goto error;
goto error; } else if (pgnr > ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
} else if (pgnr > ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) { dev_err(atomisp_dev,
dev_err(atomisp_dev, "user space memory size is large than the expected size..\n");
"user space memory size is large than the expected size..\n"); err = -ENOMEM;
err = -ENOMEM; goto error;
goto error; }
}
me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data, me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data,
attribute & ATOMISP_MAP_FLAG_CACHED); attribute & ATOMISP_MAP_FLAG_CACHED);
if (me->data == mmgr_NULL) if (me->data == mmgr_NULL)
err = -EINVAL; err = -EINVAL;
}
error: error:
if (err) { if (err) {
......
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