drm: exynos: Remove unreachable code
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 18 Nov 2016 13:57:41 +0000 (14:57 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:54:17 +0000 (13:54 +0900)
This patch reworks function arguments testing to avoid unreachable code
as pointed out with an SVACE warning:

* UNREACHABLE_CODE: This statement in the source code might be unreachable
  during program execution.
   [unreachable] unreachable at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1442
   [The condition property == 0 is always false because at this program
  point the variable property is always not equal to 0] The condition
  property == 0 is always false because at this program point the variable
  property is always not equal to 0 at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1441

* UNREACHABLE_CODE: This statement in the source code might be unreachable
  during program execution.
    [unreachable] unreachable at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1569
    [The condition event_work == 0 is always false because at this program point the
  variable event_work is always not equal to 0] The condition event_work == 0
  is always false because at this program point the variable event_work is
  always not equal to 0 at drivers/gpu/drm/exynos/exynos_drm_ipp.c:1568

Change-Id: I2a9426685c87047bf5ec3ee88b6cce4d1d7d6158
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_ipp.c

index a0279144b08186e059edea11abfa4368cb8b7543..bcd30a6b5c619414cc076367db4173f0ce0c1b06 100644 (file)
@@ -1438,11 +1438,6 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
                return -EINVAL;
        }
 
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EINVAL;
-       }
-
        mutex_lock(&c_node->event_lock);
        if (list_empty(&c_node->event_list)) {
                DRM_DEBUG_KMS("event list is empty.\n");
@@ -1559,16 +1554,16 @@ err_event_unlock:
 
 void ipp_sched_event(struct work_struct *work)
 {
-       struct drm_exynos_ipp_event_work *event_work =
-               container_of(work, struct drm_exynos_ipp_event_work, work);
+       struct drm_exynos_ipp_event_work *event_work;
        struct exynos_drm_ippdrv *ippdrv;
        struct drm_exynos_ipp_cmd_node *c_node;
        int ret;
 
-       if (!event_work) {
-               DRM_ERROR("failed to get event_work.\n");
+       if (!work) {
+               DRM_ERROR("work is NULL\n");
                return;
        }
+       event_work = container_of(work, struct drm_exynos_ipp_event_work, work);
 
        DRM_DEBUG_KMS("buf_id[%d]\n", event_work->buf_id[EXYNOS_DRM_OPS_DST]);