diff options
author | YoungJun Cho <yj44.cho@samsung.com> | 2014-05-26 04:17:15 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-06-01 13:07:13 -0400 |
commit | c66ce40b1bb2f8c16241d16b30784c8141a24888 (patch) | |
tree | e5be0b6067a194d2de06dfd872091bda967fa427 /drivers/gpu/drm | |
parent | 97f98a3b941f58e91a301e3138cdee60251590bc (diff) |
drm/exynos: ipp: remove usless list_empty() functions
list_for_each_entry() handles empty lists, so there is no
need to check whether the list is empty first.
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 61 |
1 files changed, 9 insertions, 52 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index bf71d978863d..c8cfa240c6be 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -276,11 +276,6 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id) | |||
276 | 276 | ||
277 | DRM_DEBUG_KMS("prop_id[%d]\n", prop_id); | 277 | DRM_DEBUG_KMS("prop_id[%d]\n", prop_id); |
278 | 278 | ||
279 | if (list_empty(&exynos_drm_ippdrv_list)) { | ||
280 | DRM_DEBUG_KMS("ippdrv_list is empty.\n"); | ||
281 | return ERR_PTR(-ENODEV); | ||
282 | } | ||
283 | |||
284 | /* | 279 | /* |
285 | * This case is search ipp driver by prop_id handle. | 280 | * This case is search ipp driver by prop_id handle. |
286 | * sometimes, ipp subsystem find driver by prop_id. | 281 | * sometimes, ipp subsystem find driver by prop_id. |
@@ -289,11 +284,9 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id) | |||
289 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { | 284 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { |
290 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", count++, (int)ippdrv); | 285 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", count++, (int)ippdrv); |
291 | 286 | ||
292 | if (!list_empty(&ippdrv->cmd_list)) { | 287 | list_for_each_entry(c_node, &ippdrv->cmd_list, list) |
293 | list_for_each_entry(c_node, &ippdrv->cmd_list, list) | 288 | if (c_node->property.prop_id == prop_id) |
294 | if (c_node->property.prop_id == prop_id) | 289 | return ippdrv; |
295 | return ippdrv; | ||
296 | } | ||
297 | } | 290 | } |
298 | 291 | ||
299 | return ERR_PTR(-ENODEV); | 292 | return ERR_PTR(-ENODEV); |
@@ -573,11 +566,6 @@ static int ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node) | |||
573 | /* source/destination memory list */ | 566 | /* source/destination memory list */ |
574 | head = &c_node->mem_list[i]; | 567 | head = &c_node->mem_list[i]; |
575 | 568 | ||
576 | if (list_empty(head)) { | ||
577 | DRM_DEBUG_KMS("%s memory empty.\n", i ? "dst" : "src"); | ||
578 | continue; | ||
579 | } | ||
580 | |||
581 | /* find memory node entry */ | 569 | /* find memory node entry */ |
582 | list_for_each_entry(m_node, head, list) { | 570 | list_for_each_entry(m_node, head, list) { |
583 | DRM_DEBUG_KMS("%s,count[%d]m_node[0x%x]\n", | 571 | DRM_DEBUG_KMS("%s,count[%d]m_node[0x%x]\n", |
@@ -816,11 +804,6 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node, | |||
816 | struct drm_exynos_ipp_send_event *e, *te; | 804 | struct drm_exynos_ipp_send_event *e, *te; |
817 | int count = 0; | 805 | int count = 0; |
818 | 806 | ||
819 | if (list_empty(&c_node->event_list)) { | ||
820 | DRM_DEBUG_KMS("event_list is empty.\n"); | ||
821 | return; | ||
822 | } | ||
823 | |||
824 | list_for_each_entry_safe(e, te, &c_node->event_list, base.link) { | 807 | list_for_each_entry_safe(e, te, &c_node->event_list, base.link) { |
825 | DRM_DEBUG_KMS("count[%d]e[0x%x]\n", count++, (int)e); | 808 | DRM_DEBUG_KMS("count[%d]e[0x%x]\n", count++, (int)e); |
826 | 809 | ||
@@ -918,14 +901,12 @@ static void ipp_clean_queue_buf(struct drm_device *drm_dev, | |||
918 | { | 901 | { |
919 | struct drm_exynos_ipp_mem_node *m_node, *tm_node; | 902 | struct drm_exynos_ipp_mem_node *m_node, *tm_node; |
920 | 903 | ||
921 | if (!list_empty(&c_node->mem_list[qbuf->ops_id])) { | 904 | /* delete list */ |
922 | /* delete list */ | 905 | list_for_each_entry_safe(m_node, tm_node, |
923 | list_for_each_entry_safe(m_node, tm_node, | 906 | &c_node->mem_list[qbuf->ops_id], list) { |
924 | &c_node->mem_list[qbuf->ops_id], list) { | 907 | if (m_node->buf_id == qbuf->buf_id && |
925 | if (m_node->buf_id == qbuf->buf_id && | 908 | m_node->ops_id == qbuf->ops_id) |
926 | m_node->ops_id == qbuf->ops_id) | 909 | ipp_put_mem_node(drm_dev, c_node, m_node); |
927 | ipp_put_mem_node(drm_dev, c_node, m_node); | ||
928 | } | ||
929 | } | 910 | } |
930 | } | 911 | } |
931 | 912 | ||
@@ -1361,11 +1342,6 @@ static int ipp_stop_property(struct drm_device *drm_dev, | |||
1361 | /* source/destination memory list */ | 1342 | /* source/destination memory list */ |
1362 | head = &c_node->mem_list[i]; | 1343 | head = &c_node->mem_list[i]; |
1363 | 1344 | ||
1364 | if (list_empty(head)) { | ||
1365 | DRM_DEBUG_KMS("mem_list is empty.\n"); | ||
1366 | break; | ||
1367 | } | ||
1368 | |||
1369 | list_for_each_entry_safe(m_node, tm_node, | 1345 | list_for_each_entry_safe(m_node, tm_node, |
1370 | head, list) { | 1346 | head, list) { |
1371 | ret = ipp_put_mem_node(drm_dev, c_node, | 1347 | ret = ipp_put_mem_node(drm_dev, c_node, |
@@ -1381,11 +1357,6 @@ static int ipp_stop_property(struct drm_device *drm_dev, | |||
1381 | /* destination memory list */ | 1357 | /* destination memory list */ |
1382 | head = &c_node->mem_list[EXYNOS_DRM_OPS_DST]; | 1358 | head = &c_node->mem_list[EXYNOS_DRM_OPS_DST]; |
1383 | 1359 | ||
1384 | if (list_empty(head)) { | ||
1385 | DRM_DEBUG_KMS("mem_list is empty.\n"); | ||
1386 | break; | ||
1387 | } | ||
1388 | |||
1389 | list_for_each_entry_safe(m_node, tm_node, head, list) { | 1360 | list_for_each_entry_safe(m_node, tm_node, head, list) { |
1390 | ret = ipp_put_mem_node(drm_dev, c_node, m_node); | 1361 | ret = ipp_put_mem_node(drm_dev, c_node, m_node); |
1391 | if (ret) { | 1362 | if (ret) { |
@@ -1398,11 +1369,6 @@ static int ipp_stop_property(struct drm_device *drm_dev, | |||
1398 | /* source memory list */ | 1369 | /* source memory list */ |
1399 | head = &c_node->mem_list[EXYNOS_DRM_OPS_SRC]; | 1370 | head = &c_node->mem_list[EXYNOS_DRM_OPS_SRC]; |
1400 | 1371 | ||
1401 | if (list_empty(head)) { | ||
1402 | DRM_DEBUG_KMS("mem_list is empty.\n"); | ||
1403 | break; | ||
1404 | } | ||
1405 | |||
1406 | list_for_each_entry_safe(m_node, tm_node, head, list) { | 1372 | list_for_each_entry_safe(m_node, tm_node, head, list) { |
1407 | ret = ipp_put_mem_node(drm_dev, c_node, m_node); | 1373 | ret = ipp_put_mem_node(drm_dev, c_node, m_node); |
1408 | if (ret) { | 1374 | if (ret) { |
@@ -1790,15 +1756,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev, | |||
1790 | 1756 | ||
1791 | DRM_DEBUG_KMS("for priv[0x%x]\n", (int)priv); | 1757 | DRM_DEBUG_KMS("for priv[0x%x]\n", (int)priv); |
1792 | 1758 | ||
1793 | if (list_empty(&exynos_drm_ippdrv_list)) { | ||
1794 | DRM_DEBUG_KMS("ippdrv_list is empty.\n"); | ||
1795 | goto err_clear; | ||
1796 | } | ||
1797 | |||
1798 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { | 1759 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { |
1799 | if (list_empty(&ippdrv->cmd_list)) | ||
1800 | continue; | ||
1801 | |||
1802 | list_for_each_entry_safe(c_node, tc_node, | 1760 | list_for_each_entry_safe(c_node, tc_node, |
1803 | &ippdrv->cmd_list, list) { | 1761 | &ippdrv->cmd_list, list) { |
1804 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", | 1762 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", |
@@ -1825,7 +1783,6 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev, | |||
1825 | } | 1783 | } |
1826 | } | 1784 | } |
1827 | 1785 | ||
1828 | err_clear: | ||
1829 | kfree(priv); | 1786 | kfree(priv); |
1830 | return; | 1787 | return; |
1831 | } | 1788 | } |