Skip to content

Commit

Permalink
drm/panfrost: Remove incorrect IS_ERR() check
Browse files Browse the repository at this point in the history
sg_page_iter_page() doesn't return an error code, so the IS_ERR() check
is wrong and the error path will never be executed. This also allows
simplifying the code to remove the local variable 'page'.

CC: Adrián Larumbe <adrian.larumbe@collabora.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/376713ff-9a4f-4ea3-b097-fb5efb685d95@moroto.mountain
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Tested-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231020104405.53992-1-steven.price@arm.com
  • Loading branch information
Steven Price committed Oct 30, 2023
1 parent 79d9436 commit b2139fb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/gpu/drm/panfrost/panfrost_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,8 @@ void panfrost_core_dump(struct panfrost_job *job)

iter.hdr->bomap.data[0] = bomap - bomap_start;

for_each_sgtable_page(bo->base.sgt, &page_iter, 0) {
struct page *page = sg_page_iter_page(&page_iter);

if (!IS_ERR(page)) {
*bomap++ = page_to_phys(page);
} else {
dev_err(pfdev->dev, "Panfrost Dump: wrong page\n");
*bomap++ = 0;
}
}
for_each_sgtable_page(bo->base.sgt, &page_iter, 0)
*bomap++ = page_to_phys(sg_page_iter_page(&page_iter));

iter.hdr->bomap.iova = mapping->mmnode.start << PAGE_SHIFT;

Expand Down

0 comments on commit b2139fb

Please sign in to comment.