Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos/ipp: simplify ipp_create_id

There is no gain in passing id by pointer to be filled.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Andrzej Hajda and committed by
Inki Dae
12ff54d2 57ace335

+9 -19
+9 -19
drivers/gpu/drm/exynos/exynos_drm_ipp.c
··· 145 145 return 0; 146 146 } 147 147 148 - static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj, 149 - u32 *idp) 148 + static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj) 150 149 { 151 150 int ret; 152 151 153 - /* do the allocation under our mutexlock */ 154 152 mutex_lock(lock); 155 153 ret = idr_alloc(id_idr, obj, 1, 0, GFP_KERNEL); 156 154 mutex_unlock(lock); 157 - if (ret < 0) 158 - return ret; 159 155 160 - *idp = ret; 161 - return 0; 156 + return ret; 162 157 } 163 158 164 159 static void ipp_remove_id(struct idr *id_idr, struct mutex *lock, u32 id) ··· 466 471 if (!c_node) 467 472 return -ENOMEM; 468 473 469 - /* create property id */ 470 - ret = ipp_create_id(&ctx->prop_idr, &ctx->prop_lock, c_node, 471 - &property->prop_id); 472 - if (ret) { 474 + ret = ipp_create_id(&ctx->prop_idr, &ctx->prop_lock, c_node); 475 + if (ret < 0) { 473 476 DRM_ERROR("failed to create id.\n"); 474 477 goto err_clear; 475 478 } 479 + property->prop_id = ret; 476 480 477 481 DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[0x%x]\n", 478 482 property->prop_id, property->cmd, (int)ippdrv); ··· 1630 1636 1631 1637 /* get ipp driver entry */ 1632 1638 list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { 1633 - u32 ipp_id; 1634 - 1635 1639 ippdrv->drm_dev = drm_dev; 1636 1640 1637 - ret = ipp_create_id(&ctx->ipp_idr, &ctx->ipp_lock, ippdrv, 1638 - &ipp_id); 1639 - if (ret || ipp_id == 0) { 1641 + ret = ipp_create_id(&ctx->ipp_idr, &ctx->ipp_lock, ippdrv); 1642 + if (ret < 0) { 1640 1643 DRM_ERROR("failed to create id.\n"); 1641 1644 goto err; 1642 1645 } 1646 + ippdrv->prop_list.ipp_id = ret; 1643 1647 1644 1648 DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]ipp_id[%d]\n", 1645 - count++, (int)ippdrv, ipp_id); 1646 - 1647 - ippdrv->prop_list.ipp_id = ipp_id; 1649 + count++, (int)ippdrv, ret); 1648 1650 1649 1651 /* store parent device for node */ 1650 1652 ippdrv->parent_dev = dev;