drm: remove pointless checks in radeon_state
authorDave Airlie <airlied@linux.ie>
Sun, 19 Mar 2006 09:15:41 +0000 (20:15 +1100)
committerDave Airlie <airlied@linux.ie>
Sun, 19 Mar 2006 09:15:41 +0000 (20:15 +1100)
If these were valid checks, we'd have already oopsed several
lines above where we were already dereferencing them.

DA: these used to be valid but other changes made them unnecessary.

Coverity: 776,777,778
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/radeon_state.c

index b006b1c5d856830bd75d7639156cb67419dfd608..c5b8f774a599b0db17ab9e3db42052822b79cf50 100644 (file)
@@ -1970,11 +1970,6 @@ static int radeon_surface_alloc(DRM_IOCTL_ARGS)
        drm_radeon_private_t *dev_priv = dev->dev_private;
        drm_radeon_surface_alloc_t alloc;
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_COPY_FROM_USER_IOCTL(alloc,
                                 (drm_radeon_surface_alloc_t __user *) data,
                                 sizeof(alloc));
@@ -1991,11 +1986,6 @@ static int radeon_surface_free(DRM_IOCTL_ARGS)
        drm_radeon_private_t *dev_priv = dev->dev_private;
        drm_radeon_surface_free_t memfree;
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_COPY_FROM_USER_IOCTL(memfree, (drm_radeon_surface_free_t __user *) data,
                                 sizeof(memfree));
 
@@ -2131,11 +2121,6 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)
 
        LOCK_TEST_WITH_RETURN(dev, filp);
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
 
        DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex_t __user *) data,
@@ -2220,11 +2205,6 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)
 
        LOCK_TEST_WITH_RETURN(dev, filp);
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
 
        DRM_COPY_FROM_USER_IOCTL(elts, (drm_radeon_indices_t __user *) data,
@@ -2371,11 +2351,6 @@ static int radeon_cp_indirect(DRM_IOCTL_ARGS)
 
        LOCK_TEST_WITH_RETURN(dev, filp);
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_COPY_FROM_USER_IOCTL(indirect,
                                 (drm_radeon_indirect_t __user *) data,
                                 sizeof(indirect));
@@ -2448,11 +2423,6 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)
 
        LOCK_TEST_WITH_RETURN(dev, filp);
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
 
        DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex2_t __user *) data,
@@ -2769,11 +2739,6 @@ static int radeon_cp_cmdbuf(DRM_IOCTL_ARGS)
 
        LOCK_TEST_WITH_RETURN(dev, filp);
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
 
        DRM_COPY_FROM_USER_IOCTL(cmdbuf,
@@ -2928,11 +2893,6 @@ static int radeon_cp_getparam(DRM_IOCTL_ARGS)
        drm_radeon_getparam_t param;
        int value;
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_COPY_FROM_USER_IOCTL(param, (drm_radeon_getparam_t __user *) data,
                                 sizeof(param));
 
@@ -3012,11 +2972,6 @@ static int radeon_cp_setparam(DRM_IOCTL_ARGS)
        drm_radeon_setparam_t sp;
        struct drm_radeon_driver_file_fields *radeon_priv;
 
-       if (!dev_priv) {
-               DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
-               return DRM_ERR(EINVAL);
-       }
-
        DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
 
        DRM_COPY_FROM_USER_IOCTL(sp, (drm_radeon_setparam_t __user *) data,