Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, <linux-kernel@vger.kernel.org>
Cc: <intel-xe@lists.freedesktop.org>, <linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>, <akinobu.mita@gmail.com>,
	<akpm@linux-foundation.org>, <lucas.demarchi@intel.com>,
	<rodrigo.vivi@intel.com>, <thomas.hellstrom@linux.intel.com>,
	<robdclark@gmail.com>, <quic_abhinavk@quicinc.com>,
	<dmitry.baryshkov@linaro.org>
Subject: Re: [PATCH 1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n
Date: Tue, 13 Aug 2024 18:25:57 +0530	[thread overview]
Message-ID: <c089e457-6461-4a43-94d3-25e4b19bf52b@intel.com> (raw)
In-Reply-To: <20240813121237.2382534-1-jani.nikula@intel.com>



On 13-08-2024 17:42, Jani Nikula wrote:
> The fault-inject.h users across the kernel need to add a lot of #ifdef
> CONFIG_FAULT_INJECTION to cater for shortcomings in the header. Make
> fault-inject.h self-contained for CONFIG_FAULT_INJECTION=n, and add
> stubs for DECLARE_FAULT_ATTR(), setup_fault_attr(), should_fail_ex(),
> and should_fail() to allow removal of conditional compilation.

Would a "Fixes" tag be appropriate here?
Fixes: 6ff1cb355e62 ("[PATCH] fault-injection capabilities infrastructure")

> 
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   include/linux/fault-inject.h | 36 +++++++++++++++++++++++++++++-------
>   1 file changed, 29 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
> index 354413950d34..8c829d28dcf3 100644
> --- a/include/linux/fault-inject.h
> +++ b/include/linux/fault-inject.h
> @@ -2,13 +2,17 @@
>   #ifndef _LINUX_FAULT_INJECT_H
>   #define _LINUX_FAULT_INJECT_H
>   
> +#include <linux/err.h>
> +#include <linux/types.h>
> +
> +struct dentry;
> +struct kmem_cache;
> +
>   #ifdef CONFIG_FAULT_INJECTION
>   
> -#include <linux/types.h>
> -#include <linux/debugfs.h>
> +#include <linux/atomic.h>
>   #include <linux/configfs.h>
>   #include <linux/ratelimit.h>
> -#include <linux/atomic.h>
>   
>   /*
>    * For explanation of the elements of this struct, see
> @@ -51,6 +55,28 @@ int setup_fault_attr(struct fault_attr *attr, char *str);
>   bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags);
>   bool should_fail(struct fault_attr *attr, ssize_t size);
>   
> +#else /* CONFIG_FAULT_INJECTION */
> +
> +struct fault_attr {
> +};
> +
> +#define DECLARE_FAULT_ATTR(name) struct fault_attr name = {}
> +
> +static inline int setup_fault_attr(struct fault_attr *attr, char *str)
> +{
> +	return 0; /* Note: 0 means error for __setup() handlers! */
> +}
> +static inline bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags)
> +{
> +	return false;
> +}
> +static inline bool should_fail(struct fault_attr *attr, ssize_t size)
> +{
> +	return false;
> +}
> +
> +#endif /* CONFIG_FAULT_INJECTION */
> +
>   #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
>   
>   struct dentry *fault_create_debugfs_attr(const char *name,
> @@ -87,10 +113,6 @@ static inline void fault_config_init(struct fault_config *config,
>   
>   #endif /* CONFIG_FAULT_INJECTION_CONFIGFS */
>   
> -#endif /* CONFIG_FAULT_INJECTION */
> -
> -struct kmem_cache;
> -
>   #ifdef CONFIG_FAIL_PAGE_ALLOC
>   bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order);
>   #else

  parent reply	other threads:[~2024-08-13 12:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 12:12 [PATCH 1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n Jani Nikula
2024-08-13 12:12 ` [PATCH 2/3] drm/msm: clean up fault injection usage Jani Nikula
2024-08-13 12:30   ` Thomas Hellström
2024-08-13 12:54   ` Ghimiray, Himal Prasad
2024-08-14 23:38   ` Abhinav Kumar
2024-08-13 12:12 ` [PATCH 3/3] drm/xe: " Jani Nikula
2024-08-13 12:32   ` Thomas Hellström
2024-08-13 12:50   ` Ghimiray, Himal Prasad
2024-08-13 12:19 ` ✓ CI.Patch_applied: success for series starting with [1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n Patchwork
2024-08-13 12:19 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-13 12:20 ` ✓ CI.KUnit: success " Patchwork
2024-08-13 12:24 ` ✗ CI.Build: failure " Patchwork
2024-08-13 12:55 ` Ghimiray, Himal Prasad [this message]
2024-08-14  2:24 ` [PATCH 1/3] " Andrew Morton
2024-08-14  6:57   ` Jani Nikula
2024-08-14 19:12     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c089e457-6461-4a43-94d3-25e4b19bf52b@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox