diff mbox series

[2/3] drm/msm: clean up fault injection usage

Message ID 20240813121237.2382534-2-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n | expand

Commit Message

Jani Nikula Aug. 13, 2024, 12:12 p.m. UTC
With the proper stubs in place in linux/fault-inject.h, we can remove a
bunch of conditional compilation for CONFIG_FAULT_INJECTION=n.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/msm/msm_debugfs.c | 2 --
 drivers/gpu/drm/msm/msm_drv.c     | 2 --
 drivers/gpu/drm/msm/msm_drv.h     | 4 ----
 3 files changed, 8 deletions(-)

Comments

Thomas Hellstrom Aug. 13, 2024, 12:30 p.m. UTC | #1
On Tue, 2024-08-13 at 15:12 +0300, Jani Nikula wrote:
> With the proper stubs in place in linux/fault-inject.h, we can remove
> a
> bunch of conditional compilation for CONFIG_FAULT_INJECTION=n.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

LGTM.
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

> ---
>  drivers/gpu/drm/msm/msm_debugfs.c | 2 --
>  drivers/gpu/drm/msm/msm_drv.c     | 2 --
>  drivers/gpu/drm/msm/msm_drv.h     | 4 ----
>  3 files changed, 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_debugfs.c
> b/drivers/gpu/drm/msm/msm_debugfs.c
> index 4494f6d1c7cb..7ab607252d18 100644
> --- a/drivers/gpu/drm/msm/msm_debugfs.c
> +++ b/drivers/gpu/drm/msm/msm_debugfs.c
> @@ -357,12 +357,10 @@ void msm_debugfs_init(struct drm_minor *minor)
>  	if (priv->kms && priv->kms->funcs->debugfs_init)
>  		priv->kms->funcs->debugfs_init(priv->kms, minor);
>  
> -#ifdef CONFIG_FAULT_INJECTION
>  	fault_create_debugfs_attr("fail_gem_alloc", minor-
> >debugfs_root,
>  				  &fail_gem_alloc);
>  	fault_create_debugfs_attr("fail_gem_iova", minor-
> >debugfs_root,
>  				  &fail_gem_iova);
> -#endif
>  }
>  #endif
>  
> diff --git a/drivers/gpu/drm/msm/msm_drv.c
> b/drivers/gpu/drm/msm/msm_drv.c
> index 9c33f4e3f822..6938410f4fc7 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -58,10 +58,8 @@ static bool modeset = true;
>  MODULE_PARM_DESC(modeset, "Use kernel modesetting [KMS] (1=on
> (default), 0=disable)");
>  module_param(modeset, bool, 0600);
>  
> -#ifdef CONFIG_FAULT_INJECTION
>  DECLARE_FAULT_ATTR(fail_gem_alloc);
>  DECLARE_FAULT_ATTR(fail_gem_iova);
> -#endif
>  
>  static int msm_drm_uninit(struct device *dev)
>  {
> diff --git a/drivers/gpu/drm/msm/msm_drv.h
> b/drivers/gpu/drm/msm/msm_drv.h
> index be016d7b4ef1..9b953860131b 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -33,12 +33,8 @@
>  #include <drm/msm_drm.h>
>  #include <drm/drm_gem.h>
>  
> -#ifdef CONFIG_FAULT_INJECTION
>  extern struct fault_attr fail_gem_alloc;
>  extern struct fault_attr fail_gem_iova;
> -#else
> -#  define should_fail(attr, size) 0
> -#endif
>  
>  struct msm_kms;
>  struct msm_gpu;
Ghimiray, Himal Prasad Aug. 13, 2024, 12:54 p.m. UTC | #2
On 13-08-2024 17:42, Jani Nikula wrote:
> With the proper stubs in place in linux/fault-inject.h, we can remove a
> bunch of conditional compilation for CONFIG_FAULT_INJECTION=n.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/msm/msm_debugfs.c | 2 --
>   drivers/gpu/drm/msm/msm_drv.c     | 2 --
>   drivers/gpu/drm/msm/msm_drv.h     | 4 ----
>   3 files changed, 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
> index 4494f6d1c7cb..7ab607252d18 100644
> --- a/drivers/gpu/drm/msm/msm_debugfs.c
> +++ b/drivers/gpu/drm/msm/msm_debugfs.c
> @@ -357,12 +357,10 @@ void msm_debugfs_init(struct drm_minor *minor)
>   	if (priv->kms && priv->kms->funcs->debugfs_init)
>   		priv->kms->funcs->debugfs_init(priv->kms, minor);
>   
> -#ifdef CONFIG_FAULT_INJECTION
>   	fault_create_debugfs_attr("fail_gem_alloc", minor->debugfs_root,
>   				  &fail_gem_alloc);
>   	fault_create_debugfs_attr("fail_gem_iova", minor->debugfs_root,
>   				  &fail_gem_iova);
> -#endif
>   }
>   #endif
>   
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 9c33f4e3f822..6938410f4fc7 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -58,10 +58,8 @@ static bool modeset = true;
>   MODULE_PARM_DESC(modeset, "Use kernel modesetting [KMS] (1=on (default), 0=disable)");
>   module_param(modeset, bool, 0600);
>   
> -#ifdef CONFIG_FAULT_INJECTION
>   DECLARE_FAULT_ATTR(fail_gem_alloc);
>   DECLARE_FAULT_ATTR(fail_gem_iova);
> -#endif
>   
>   static int msm_drm_uninit(struct device *dev)
>   {
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index be016d7b4ef1..9b953860131b 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -33,12 +33,8 @@
>   #include <drm/msm_drm.h>
>   #include <drm/drm_gem.h>
>   
> -#ifdef CONFIG_FAULT_INJECTION
>   extern struct fault_attr fail_gem_alloc;
>   extern struct fault_attr fail_gem_iova;
> -#else
> -#  define should_fail(attr, size) 0
> -#endif

LGTM
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

>   
>   struct msm_kms;
>   struct msm_gpu;
Abhinav Kumar Aug. 14, 2024, 11:38 p.m. UTC | #3
On 8/13/2024 5:12 AM, Jani Nikula wrote:
> With the proper stubs in place in linux/fault-inject.h, we can remove a
> bunch of conditional compilation for CONFIG_FAULT_INJECTION=n.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/msm/msm_debugfs.c | 2 --
>   drivers/gpu/drm/msm/msm_drv.c     | 2 --
>   drivers/gpu/drm/msm/msm_drv.h     | 4 ----
>   3 files changed, 8 deletions(-)
> 

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
index 4494f6d1c7cb..7ab607252d18 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -357,12 +357,10 @@  void msm_debugfs_init(struct drm_minor *minor)
 	if (priv->kms && priv->kms->funcs->debugfs_init)
 		priv->kms->funcs->debugfs_init(priv->kms, minor);
 
-#ifdef CONFIG_FAULT_INJECTION
 	fault_create_debugfs_attr("fail_gem_alloc", minor->debugfs_root,
 				  &fail_gem_alloc);
 	fault_create_debugfs_attr("fail_gem_iova", minor->debugfs_root,
 				  &fail_gem_iova);
-#endif
 }
 #endif
 
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 9c33f4e3f822..6938410f4fc7 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -58,10 +58,8 @@  static bool modeset = true;
 MODULE_PARM_DESC(modeset, "Use kernel modesetting [KMS] (1=on (default), 0=disable)");
 module_param(modeset, bool, 0600);
 
-#ifdef CONFIG_FAULT_INJECTION
 DECLARE_FAULT_ATTR(fail_gem_alloc);
 DECLARE_FAULT_ATTR(fail_gem_iova);
-#endif
 
 static int msm_drm_uninit(struct device *dev)
 {
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index be016d7b4ef1..9b953860131b 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -33,12 +33,8 @@ 
 #include <drm/msm_drm.h>
 #include <drm/drm_gem.h>
 
-#ifdef CONFIG_FAULT_INJECTION
 extern struct fault_attr fail_gem_alloc;
 extern struct fault_attr fail_gem_iova;
-#else
-#  define should_fail(attr, size) 0
-#endif
 
 struct msm_kms;
 struct msm_gpu;