Messages in this thread | | | Date | Thu, 12 Dec 2019 06:54:32 -0800 | From | Christoph Hellwig <> | Subject | Re: [PATCH] x86/platform/uv: avoid unused variable warning |
| |
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.
| |