Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1167132 > unrolled thread

[PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context Functions")

Started byEddie Kovsky <ewk@edkovsky.org>
First post2015-06-17 22:20 +0200
Last post2015-06-18 07:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context  Functions") Eddie Kovsky <ewk@edkovsky.org> - 2015-06-17 22:20 +0200
    Re: [PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context  Functions") Daniel Vetter <daniel@ffwll.ch> - 2015-06-18 07:30 +0200

#1167132 — [PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context Functions")

FromEddie Kovsky <ewk@edkovsky.org>
Date2015-06-17 22:20 +0200
Subject[PATCH] Fixes: 9697dffb098d ("drm: Turn off Legacy Context Functions")
Message-ID<pCrYt-3rc-1@gated-at.bofh.it>
Commit 9697dffb098d ("drm: Turn off Legacy Context Functions")
added checks for legacy features to several functions in the 
drm driver. It is now possible for the void functions changed by 
this commit to return an int error code. This patch updates
the function definitions to return int. This fixes the build warnings:

warning: ‘return’ with a value, in function returning void
   return -EINVAL

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
---
 drivers/gpu/drm/drm_context.c | 12 +++++++++---
 drivers/gpu/drm/drm_legacy.h  |  6 +++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
index f3ea657f6574..3c2f4a76f934 100644
--- a/drivers/gpu/drm/drm_context.c
+++ b/drivers/gpu/drm/drm_context.c
@@ -51,7 +51,7 @@ struct drm_ctx_list {
  * in drm_device::ctx_idr, while holding the drm_device::struct_mutex
  * lock.
  */
-void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
+int drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
 {
 	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
 		drm_core_check_feature(dev, DRIVER_MODESET))
@@ -60,6 +60,8 @@ void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
 	mutex_lock(&dev->struct_mutex);
 	idr_remove(&dev->ctx_idr, ctx_handle);
 	mutex_unlock(&dev->struct_mutex);
+
+	return 0;
 }
 
 /**
@@ -107,7 +109,7 @@ int drm_legacy_ctxbitmap_init(struct drm_device * dev)
  * Free all idr members using drm_ctx_sarea_free helper function
  * while holding the drm_device::struct_mutex lock.
  */
-void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
+int drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
 {
 	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
 		drm_core_check_feature(dev, DRIVER_MODESET))
@@ -116,6 +118,8 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
 	mutex_lock(&dev->struct_mutex);
 	idr_destroy(&dev->ctx_idr);
 	mutex_unlock(&dev->struct_mutex);
+
+	return 0;
 }
 
 /**
@@ -127,7 +131,7 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
  * @file. Note that after this call returns, new contexts might be added if
  * the file is still alive.
  */
-void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
+int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
 {
 	struct drm_ctx_list *pos, *tmp;
 
@@ -150,6 +154,8 @@ void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
 	}
 
 	mutex_unlock(&dev->ctxlist_mutex);
+
+	return 0;
 }
 
 /*@}*/
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index c1dc61473db5..26c16220e475 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -43,9 +43,9 @@ struct drm_file;
 #define DRM_RESERVED_CONTEXTS		1
 
 int drm_legacy_ctxbitmap_init(struct drm_device *dev);
-void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
-void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
-void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
+int drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
+int drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
+int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
 
 int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
 int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1167593

FromDaniel Vetter <daniel@ffwll.ch>
Date2015-06-18 07:30 +0200
Message-ID<pCAyK-7oA-7@gated-at.bofh.it>
In reply to#1167132
On Wed, Jun 17, 2015 at 02:03:47PM -0600, Eddie Kovsky wrote:
> Commit 9697dffb098d ("drm: Turn off Legacy Context Functions")
> added checks for legacy features to several functions in the 
> drm driver. It is now possible for the void functions changed by 
> this commit to return an int error code. This patch updates
> the function definitions to return int. This fixes the build warnings:
> 
> warning: ‘return’ with a value, in function returning void
>    return -EINVAL
> 
> Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>

Oops sorry, I spotted this while applying but somehow screwed up and still
pushed out the patch. Dropped it now for real.

Thanks, Daniel

> ---
>  drivers/gpu/drm/drm_context.c | 12 +++++++++---
>  drivers/gpu/drm/drm_legacy.h  |  6 +++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
> index f3ea657f6574..3c2f4a76f934 100644
> --- a/drivers/gpu/drm/drm_context.c
> +++ b/drivers/gpu/drm/drm_context.c
> @@ -51,7 +51,7 @@ struct drm_ctx_list {
>   * in drm_device::ctx_idr, while holding the drm_device::struct_mutex
>   * lock.
>   */
> -void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
> +int drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
>  {
>  	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
>  		drm_core_check_feature(dev, DRIVER_MODESET))
> @@ -60,6 +60,8 @@ void drm_legacy_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
>  	mutex_lock(&dev->struct_mutex);
>  	idr_remove(&dev->ctx_idr, ctx_handle);
>  	mutex_unlock(&dev->struct_mutex);
> +
> +	return 0;
>  }
>  
>  /**
> @@ -107,7 +109,7 @@ int drm_legacy_ctxbitmap_init(struct drm_device * dev)
>   * Free all idr members using drm_ctx_sarea_free helper function
>   * while holding the drm_device::struct_mutex lock.
>   */
> -void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
> +int drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
>  {
>  	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
>  		drm_core_check_feature(dev, DRIVER_MODESET))
> @@ -116,6 +118,8 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
>  	mutex_lock(&dev->struct_mutex);
>  	idr_destroy(&dev->ctx_idr);
>  	mutex_unlock(&dev->struct_mutex);
> +
> +	return 0;
>  }
>  
>  /**
> @@ -127,7 +131,7 @@ void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
>   * @file. Note that after this call returns, new contexts might be added if
>   * the file is still alive.
>   */
> -void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
> +int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
>  {
>  	struct drm_ctx_list *pos, *tmp;
>  
> @@ -150,6 +154,8 @@ void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file)
>  	}
>  
>  	mutex_unlock(&dev->ctxlist_mutex);
> +
> +	return 0;
>  }
>  
>  /*@}*/
> diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
> index c1dc61473db5..26c16220e475 100644
> --- a/drivers/gpu/drm/drm_legacy.h
> +++ b/drivers/gpu/drm/drm_legacy.h
> @@ -43,9 +43,9 @@ struct drm_file;
>  #define DRM_RESERVED_CONTEXTS		1
>  
>  int drm_legacy_ctxbitmap_init(struct drm_device *dev);
> -void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
> -void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
> -void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
> +int drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
> +int drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
> +int drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
>  
>  int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
>  int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
> -- 
> 2.4.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web