lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d54a148-922d-3da4-b564-44996ca56241@huawei.com>
Date:   Wed, 27 Apr 2022 09:56:35 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <mcgrof@...nel.org>, <tangmeng@...ontech.com>
CC:     <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] reboot: Fix build warning without CONFIG_SYSFS

ping...

On 2022/4/7 15:48, YueHaibing wrote:
> If CONFIG_SYSFS is n, build warn:
> 
> kernel/reboot.c:443:20: error: ‘kernel_reboot_sysctls_init’ defined but not used [-Werror=unused-function]
>  static void __init kernel_reboot_sysctls_init(void)
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Move kernel_reboot_sysctls_init() to #ifdef block to fix this.
> 
> Fixes: 6e73c8344931 ("kernel/reboot: move reboot sysctls to its own file")
> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
>  kernel/reboot.c | 54 ++++++++++++++++++++++++-------------------------
>  1 file changed, 27 insertions(+), 27 deletions(-)
> 
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index ed4e6dfb7d44..ecbf09ea03c5 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -421,33 +421,6 @@ void ctrl_alt_del(void)
>  static char poweroff_cmd[POWEROFF_CMD_PATH_LEN] = "/sbin/poweroff";
>  static const char reboot_cmd[] = "/sbin/reboot";
>  
> -#ifdef CONFIG_SYSCTL
> -static struct ctl_table kern_reboot_table[] = {
> -	{
> -		.procname       = "poweroff_cmd",
> -		.data           = &poweroff_cmd,
> -		.maxlen         = POWEROFF_CMD_PATH_LEN,
> -		.mode           = 0644,
> -		.proc_handler   = proc_dostring,
> -	},
> -	{
> -		.procname       = "ctrl-alt-del",
> -		.data           = &C_A_D,
> -		.maxlen         = sizeof(int),
> -		.mode           = 0644,
> -		.proc_handler   = proc_dointvec,
> -	},
> -	{ }
> -};
> -
> -static void __init kernel_reboot_sysctls_init(void)
> -{
> -	register_sysctl_init("kernel", kern_reboot_table);
> -}
> -#else
> -#define kernel_reboot_sysctls_init() do { } while (0)
> -#endif /* CONFIG_SYSCTL */
> -
>  static int run_cmd(const char *cmd)
>  {
>  	char **argv;
> @@ -895,6 +868,33 @@ static struct attribute *reboot_attrs[] = {
>  	NULL,
>  };
>  
> +#ifdef CONFIG_SYSCTL
> +static struct ctl_table kern_reboot_table[] = {
> +	{
> +		.procname       = "poweroff_cmd",
> +		.data           = &poweroff_cmd,
> +		.maxlen         = POWEROFF_CMD_PATH_LEN,
> +		.mode           = 0644,
> +		.proc_handler   = proc_dostring,
> +	},
> +	{
> +		.procname       = "ctrl-alt-del",
> +		.data           = &C_A_D,
> +		.maxlen         = sizeof(int),
> +		.mode           = 0644,
> +		.proc_handler   = proc_dointvec,
> +	},
> +	{ }
> +};
> +
> +static void __init kernel_reboot_sysctls_init(void)
> +{
> +	register_sysctl_init("kernel", kern_reboot_table);
> +}
> +#else
> +#define kernel_reboot_sysctls_init() do { } while (0)
> +#endif /* CONFIG_SYSCTL */
> +
>  static const struct attribute_group reboot_attr_group = {
>  	.attrs = reboot_attrs,
>  };
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ