Re: [PATCH] fs: quota: avoid unused function warning for !CONFIG_SYSCTL
From: Jan Kara
Date: Wed Mar 29 2023 - 05:44:15 EST
On Tue 28-03-23 10:48:20, Luis Chamberlain wrote:
> On Tue, Mar 28, 2023 at 02:22:31PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@xxxxxxxx>
> > Note: it may be better to just revert the 63d00e08515b patch, as the
> > -#ifdef CONFIG_SYSCTL
> > - if (!register_sysctl("fs/quota", fs_dqstats_table))
> > - pr_notice("quota sysctl registration failed!\n");
> > -#endif
> > + if (IS_ENABLED(CONFIG_SYSCTL)) {
> > + if (!register_sysctl("fs/quota", fs_dqstats_table))
> > + pr_notice("quota sysctl registration failed!\n");
> > + }
>
> I'd agree to drop that patch and instead just use register_sysctl_init()
> iwht Arnd's strategy.
Ah, indeed, register_sysctl_init() is exactly what we need here. I didn't
know about that helper. Thanks for letting me know.
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR