Re: [PATCH 2/3] kernel.h: move VERIFY_OCTAL_PERMISSIONS() to sysfs.h
From: Petr Pavlu
Date: Mon Dec 01 2025 - 14:01:41 EST
On 11/29/25 8:53 PM, Yury Norov (NVIDIA) wrote:
> The macro is related to sysfs, but is defined in kernel.h. Move it to
> the proper header, and unload the generic kernel.h.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@xxxxxxxxx>
> ---
> include/linux/kernel.h | 12 ------------
> include/linux/moduleparam.h | 2 +-
> include/linux/sysfs.h | 13 +++++++++++++
> 3 files changed, 14 insertions(+), 13 deletions(-)
>
> [...]
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 6907aedc4f74..4e390a84a8bc 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -4,7 +4,7 @@
> /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */
> #include <linux/init.h>
> #include <linux/stringify.h>
> -#include <linux/kernel.h>
> +#include <linux/sysfs.h>
If you are removing the kernel.h include from
include/linux/moduleparam.h, I think it would be good to update the file
to ensure that all necessary includes are now listed directly.
The following items are present in moduleparam.h:
* __UNIQUE_ID(), __used(), __section(), __aligned(), __always_unused()
-> linux/compiler.h,
* THIS_MODULE -> linux/init.h,
* __stringify() -> linux/stringify.h,
* u8, s8, u16, ... -> linux/types.h,
* static_assert() -> linux/build_bug.h,
* VERIFY_OCTAL_PERMISSIONS() -> linux/sysfs.h,
* ARRAY_SIZE() -> linux/array_size.h.
I suggest then updating the includes in include/linux/moduleparam.h to:
#include <linux/array_size.h>
#include <linux/build_bug.h>
#include <linux/compiler.h>
#include <linux/init.h>
#include <linux/stringify.h>
#include <linux/sysfs.h>
#include <linux/types.h>
--
Thanks,
Petr