dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vram-helper: remove unneeded #if defined/endif guards.
@ 2020-03-23 11:28 Wambui Karuga
  2020-03-23 11:37 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Wambui Karuga @ 2020-03-23 11:28 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
  Cc: gregkh, linux-kernel, dri-devel

Remove unneeded #if/#endif guards for checking whether the
CONFIG_DEBUG_FS option is set or not. If the option is not set, the
compiler optimizes the functions making the guards
unnecessary.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/drm_gem_vram_helper.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index 76506bedac11..b3201a70cbfc 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -1018,7 +1018,6 @@ static struct ttm_bo_driver bo_driver = {
  * struct drm_vram_mm
  */
 
-#if defined(CONFIG_DEBUG_FS)
 static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -1035,7 +1034,6 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
 static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
 	{ "vram-mm", drm_vram_mm_debugfs, 0, NULL },
 };
-#endif
 
 /**
  * drm_vram_mm_debugfs_init() - Register VRAM MM debugfs file.
@@ -1045,11 +1043,9 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
  */
 void drm_vram_mm_debugfs_init(struct drm_minor *minor)
 {
-#if defined(CONFIG_DEBUG_FS)
 	drm_debugfs_create_files(drm_vram_mm_debugfs_list,
 				 ARRAY_SIZE(drm_vram_mm_debugfs_list),
 				 minor->debugfs_root, minor);
-#endif
 }
 EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
 
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/vram-helper: remove unneeded #if defined/endif guards.
  2020-03-23 11:28 [PATCH] drm/vram-helper: remove unneeded #if defined/endif guards Wambui Karuga
@ 2020-03-23 11:37 ` Greg KH
  2020-03-23 15:37   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-03-23 11:37 UTC (permalink / raw)
  To: Wambui Karuga; +Cc: tzimmermann, airlied, linux-kernel, dri-devel

On Mon, Mar 23, 2020 at 02:28:02PM +0300, Wambui Karuga wrote:
> Remove unneeded #if/#endif guards for checking whether the
> CONFIG_DEBUG_FS option is set or not. If the option is not set, the
> compiler optimizes the functions making the guards
> unnecessary.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  drivers/gpu/drm/drm_gem_vram_helper.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index 76506bedac11..b3201a70cbfc 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -1018,7 +1018,6 @@ static struct ttm_bo_driver bo_driver = {
>   * struct drm_vram_mm
>   */
>  
> -#if defined(CONFIG_DEBUG_FS)
>  static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
>  {
>  	struct drm_info_node *node = (struct drm_info_node *) m->private;
> @@ -1035,7 +1034,6 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
>  static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
>  	{ "vram-mm", drm_vram_mm_debugfs, 0, NULL },
>  };
> -#endif
>  
>  /**
>   * drm_vram_mm_debugfs_init() - Register VRAM MM debugfs file.
> @@ -1045,11 +1043,9 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
>   */
>  void drm_vram_mm_debugfs_init(struct drm_minor *minor)
>  {
> -#if defined(CONFIG_DEBUG_FS)
>  	drm_debugfs_create_files(drm_vram_mm_debugfs_list,
>  				 ARRAY_SIZE(drm_vram_mm_debugfs_list),
>  				 minor->debugfs_root, minor);
> -#endif
>  }
>  EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
>  
> -- 
> 2.25.1

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/vram-helper: remove unneeded #if defined/endif guards.
  2020-03-23 11:37 ` Greg KH
@ 2020-03-23 15:37   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2020-03-23 15:37 UTC (permalink / raw)
  To: Greg KH; +Cc: tzimmermann, airlied, linux-kernel, dri-devel, Wambui Karuga

On Mon, Mar 23, 2020 at 12:37:26PM +0100, Greg KH wrote:
> On Mon, Mar 23, 2020 at 02:28:02PM +0300, Wambui Karuga wrote:
> > Remove unneeded #if/#endif guards for checking whether the
> > CONFIG_DEBUG_FS option is set or not. If the option is not set, the
> > compiler optimizes the functions making the guards
> > unnecessary.
> > 
> > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Applied, thanks a lot.
-Daniel

> > ---
> >  drivers/gpu/drm/drm_gem_vram_helper.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> > index 76506bedac11..b3201a70cbfc 100644
> > --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> > +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> > @@ -1018,7 +1018,6 @@ static struct ttm_bo_driver bo_driver = {
> >   * struct drm_vram_mm
> >   */
> >  
> > -#if defined(CONFIG_DEBUG_FS)
> >  static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
> >  {
> >  	struct drm_info_node *node = (struct drm_info_node *) m->private;
> > @@ -1035,7 +1034,6 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
> >  static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
> >  	{ "vram-mm", drm_vram_mm_debugfs, 0, NULL },
> >  };
> > -#endif
> >  
> >  /**
> >   * drm_vram_mm_debugfs_init() - Register VRAM MM debugfs file.
> > @@ -1045,11 +1043,9 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
> >   */
> >  void drm_vram_mm_debugfs_init(struct drm_minor *minor)
> >  {
> > -#if defined(CONFIG_DEBUG_FS)
> >  	drm_debugfs_create_files(drm_vram_mm_debugfs_list,
> >  				 ARRAY_SIZE(drm_vram_mm_debugfs_list),
> >  				 minor->debugfs_root, minor);
> > -#endif
> >  }
> >  EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
> >  
> > -- 
> > 2.25.1
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-24  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 11:28 [PATCH] drm/vram-helper: remove unneeded #if defined/endif guards Wambui Karuga
2020-03-23 11:37 ` Greg KH
2020-03-23 15:37   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).