Skip to content

Commit

Permalink
media: atomisp: get rid of __bo_alloc() macro
Browse files Browse the repository at this point in the history
Simplify the hmm_bo a little bit by removing this
macro. This will avoid printing twice errors when
allocations happen.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Mauro Carvalho Chehab committed May 20, 2020
1 parent 983e5ac commit 5f1e9dd
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ static unsigned int nr_to_order_bottom(unsigned int nr)
return fls(nr) - 1;
}

static struct hmm_buffer_object *__bo_alloc(struct kmem_cache *bo_cache)
{
struct hmm_buffer_object *bo;

bo = kmem_cache_alloc(bo_cache, GFP_KERNEL);
if (!bo)
dev_err(atomisp_dev, "%s: failed!\n", __func__);

return bo;
}

static int __bo_init(struct hmm_bo_device *bdev, struct hmm_buffer_object *bo,
unsigned int pgnr)
{
Expand Down Expand Up @@ -262,7 +251,7 @@ static struct hmm_buffer_object *__bo_break_up(struct hmm_bo_device *bdev,
unsigned long flags;
int ret;

new_bo = __bo_alloc(bdev->bo_cache);
new_bo = kmem_cache_alloc(bdev->bo_cache, GFP_KERNEL);
if (!new_bo) {
dev_err(atomisp_dev, "%s: __bo_alloc failed!\n", __func__);
return NULL;
Expand Down Expand Up @@ -387,7 +376,7 @@ int hmm_bo_device_init(struct hmm_bo_device *bdev,
return -ENOMEM;
}

bo = __bo_alloc(bdev->bo_cache);
bo = kmem_cache_alloc(bdev->bo_cache, GFP_KERNEL);
if (!bo) {
dev_err(atomisp_dev, "%s: __bo_alloc failed!\n", __func__);
isp_mmu_exit(&bdev->mmu);
Expand Down

0 comments on commit 5f1e9dd

Please sign in to comment.