From: Andrew Morton <akpm@linux-foundation.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
akinobu.mita@gmail.com, 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 19:24:50 -0700 [thread overview]
Message-ID: <20240813192450.9aff86552e06a48924b7bbc1@linux-foundation.org> (raw)
In-Reply-To: <20240813121237.2382534-1-jani.nikula@intel.com>
On Tue, 13 Aug 2024 15:12:35 +0300 Jani Nikula <jani.nikula@intel.com> 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.
>
> --- a/include/linux/fault-inject.h
> +++ b/include/linux/fault-inject.h
>
> -#include <linux/types.h>
> -#include <linux/debugfs.h>
Removing a nested include exposes all those sites which were
erroneously depending upon that nested include. Here's what I have
found so far, there will be more.
--- a/mm/failslab.c~fault-inject-improve-build-for-config_fault_injection=n-fix
+++ a/mm/failslab.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/fault-inject.h>
#include <linux/error-injection.h>
+#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include "slab.h"
--- a/lib/fault-inject.c~fault-inject-improve-build-for-config_fault_injection=n-fix
+++ a/lib/fault-inject.c
@@ -2,6 +2,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/random.h>
+#include <linux/debugfs.h>
#include <linux/sched.h>
#include <linux/stat.h>
#include <linux/types.h>
--- a/kernel/futex/core.c~fault-inject-improve-build-for-config_fault_injection=n-fix
+++ a/kernel/futex/core.c
@@ -34,6 +34,7 @@
#include <linux/compat.h>
#include <linux/jhash.h>
#include <linux/pagemap.h>
+#include <linux/debugfs.h>
#include <linux/plist.h>
#include <linux/memblock.h>
#include <linux/fault-inject.h>
_
next prev parent reply other threads:[~2024-08-14 2:24 UTC|newest]
Thread overview: 12+ 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:55 ` [PATCH 1/3] fault-inject: improve build for CONFIG_FAULT_INJECTION=n Ghimiray, Himal Prasad
2024-08-14 2:24 ` Andrew Morton [this message]
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=20240813192450.9aff86552e06a48924b7bbc1@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=akinobu.mita@gmail.com \
--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