Re: [PATCH 1/3] kernel.h: drop STACK_MAGIC macro
From: Jani Nikula
Date: Mon Dec 01 2025 - 02:47:10 EST
On Sat, 29 Nov 2025, "Yury Norov (NVIDIA)" <yury.norov@xxxxxxxxx> wrote:
> The macro is only used by i915. Move it to a local header and drop from
> the kernel.h.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@xxxxxxxxx>
> ---
> drivers/gpu/drm/i915/i915_utils.h | 2 ++
> include/linux/kernel.h | 2 --
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
> index a0c892e4c40d..6c197e968305 100644
> --- a/drivers/gpu/drm/i915/i915_utils.h
> +++ b/drivers/gpu/drm/i915/i915_utils.h
i915_utils.h is on a diet itself. STACK_MAGIC is only used in selftests,
please put this in i915_selftest.h.
I guess also need to include that from gt/selftest_ring_submission.c,
the only one that uses STACK_MAGIC but doesn't include i915_selftest.h.
BR,
Jani.
> @@ -32,6 +32,8 @@
> #include <linux/workqueue.h>
> #include <linux/sched/clock.h>
>
> +#define STACK_MAGIC 0xdeadbeef
> +
> #ifdef CONFIG_X86
> #include <asm/hypervisor.h>
> #endif
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 5b46924fdff5..61d63c57bc2d 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -40,8 +40,6 @@
>
> #include <uapi/linux/kernel.h>
>
> -#define STACK_MAGIC 0xdeadbeef
> -
> struct completion;
> struct user;
--
Jani Nikula, Intel