diff mbox series

drm/compat: more dummy implementations

Message ID 20210222100608.400730-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series drm/compat: more dummy implementations | expand

Commit Message

Daniel Vetter Feb. 22, 2021, 10:06 a.m. UTC
drm_noop really doesnt do much, and who cares about the permission checks.
So let's delete some code.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_ioc32.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

Maxime Ripard Feb. 25, 2021, 4:48 p.m. UTC | #1
On Mon, Feb 22, 2021 at 11:06:08AM +0100, Daniel Vetter wrote:
> drm_noop really doesnt do much, and who cares about the permission checks.

                  ^ doesn't

> So let's delete some code.

With the typo fixed,
Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime

> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_ioc32.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
> index dc734d4828a1..33390f02f5eb 100644
> --- a/drivers/gpu/drm/drm_ioc32.c
> +++ b/drivers/gpu/drm/drm_ioc32.c
> @@ -302,12 +302,8 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd,
>  			       unsigned long arg)
>  {
>  	drm_stats32_t __user *argp = (void __user *)arg;
> -	int err;
> -
> -	err = drm_ioctl_kernel(file, drm_noop, NULL, 0);
> -	if (err)
> -		return err;
>  
> +	/* getstats is defunct, just clear */
>  	if (clear_user(argp, sizeof(drm_stats32_t)))
>  		return -EFAULT;
>  	return 0;
> @@ -820,13 +816,8 @@ typedef struct drm_update_draw32 {
>  static int compat_drm_update_draw(struct file *file, unsigned int cmd,
>  				  unsigned long arg)
>  {
> -	drm_update_draw32_t update32;
> -
> -	if (copy_from_user(&update32, (void __user *)arg, sizeof(update32)))
> -		return -EFAULT;
> -
> -	return drm_ioctl_kernel(file, drm_noop, NULL,
> -				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
> +	/* update_draw is defunct */
> +	return 0;
>  }
>  #endif
>  
> -- 
> 2.30.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index dc734d4828a1..33390f02f5eb 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -302,12 +302,8 @@  static int compat_drm_getstats(struct file *file, unsigned int cmd,
 			       unsigned long arg)
 {
 	drm_stats32_t __user *argp = (void __user *)arg;
-	int err;
-
-	err = drm_ioctl_kernel(file, drm_noop, NULL, 0);
-	if (err)
-		return err;
 
+	/* getstats is defunct, just clear */
 	if (clear_user(argp, sizeof(drm_stats32_t)))
 		return -EFAULT;
 	return 0;
@@ -820,13 +816,8 @@  typedef struct drm_update_draw32 {
 static int compat_drm_update_draw(struct file *file, unsigned int cmd,
 				  unsigned long arg)
 {
-	drm_update_draw32_t update32;
-
-	if (copy_from_user(&update32, (void __user *)arg, sizeof(update32)))
-		return -EFAULT;
-
-	return drm_ioctl_kernel(file, drm_noop, NULL,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
+	/* update_draw is defunct */
+	return 0;
 }
 #endif