Re: [PATCH] x86/platform/uv: avoid unused variable warning

From: Christoph Hellwig
Date: Thu Dec 12 2019 - 09:54:54 EST


Instead of that maybe_unused mess please just use good old ifdefs.

> if (hubless)
> - proc_version_fops.open = proc_hubless_open;
> + proc_create_single("hubless", 0, pde, proc_hubless_show);
> else
> - proc_version_fops.open = proc_hubbed_open;
> + proc_create_single("hubbed", 0, pde, proc_hubbed_show);
> }

Or someone could figure out what happens if we turn the
proc_create_single stub into an inline function instead of the
define. That makes it used at a syntactic level, the big question is
if the compiler is smart enough to optimize away the unused callback
still.