Re: [PATCH 01/12] module: Move modprobe_path and modules_disabled ctl_tables into the module subsys

Luis Chamberlain
2025-05-09T16:09:46Z

On Fri, May 09, 2025 at 02:54:05PM +0200, Joel Granados wrote:
> diff --git a/kernel/module/kmod.c b/kernel/module/kmod.c
> index 25f25381251281a390b273cd8a734c92b960113a..5701629adc27b4bb5080db75f0e69f9f55e9d2ad 100644
> --- a/kernel/module/kmod.c
> +++ b/kernel/module/kmod.c
> @@ -60,7 +60,7 @@ static DEFINE_SEMAPHORE(kmod_concurrent_max, MAX_KMOD_CONCURRENT);
> /*
> modprobe_path is set via /proc/sys.
> */
> -char modprobe_path[KMOD_PATH_LEN] = CONFIG_MODPROBE_PATH;
> +static char modprobe_path[KMOD_PATH_LEN] = CONFIG_MODPROBE_PATH;
>
> static void free_modprobe_argv(struct subprocess_info *info)
> {
> @@ -177,3 +177,33 @@ int __request_module(bool wait, const char *fmt, ...)
> return ret;
> }
> EXPORT_SYMBOL(__request_module);
> +
> +#ifdef CONFIG_MODULES

kernel/Makefile:

obj-$(CONFIG_MODULES) += module/

And so you can drop this ifdef.

Other than that:

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

Luis