[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240813192450.9aff86552e06a48924b7bbc1@linux-foundation.org>
Date: Tue, 13 Aug 2024 19:24:50 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jani Nikula <jani.nikula@...el.com>
Cc: linux-kernel@...r.kernel.org, intel-xe@...ts.freedesktop.org,
linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
akinobu.mita@...il.com, lucas.demarchi@...el.com, rodrigo.vivi@...el.com,
thomas.hellstrom@...ux.intel.com, robdclark@...il.com,
quic_abhinavk@...cinc.com, dmitry.baryshkov@...aro.org
Subject: Re: [PATCH 1/3] fault-inject: improve build for
CONFIG_FAULT_INJECTION=n
On Tue, 13 Aug 2024 15:12:35 +0300 Jani Nikula <jani.nikula@...el.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>
_
Powered by blists - more mailing lists