Re: [PATCH 09/13] cpufreq: acpi-cpufreq: Remove unused ID structs
From: "Rafael J. Wysocki" <rafael@kernel.org>
Date: 2020-07-15 11:44:16
Also in:
linux-pm, lkml
On Wed, Jul 15, 2020 at 1:34 PM Lee Jones [off-list ref] wrote:
On Wed, 15 Jul 2020, Rafael J. Wysocki wrote:quoted
On Wed, Jul 15, 2020 at 5:27 AM Viresh Kumar [off-list ref] wrote:quoted
On 15-07-20, 08:54, Viresh Kumar wrote:quoted
On 14-07-20, 22:03, Lee Jones wrote:quoted
On Tue, 14 Jul 2020, Rafael J. Wysocki wrote:quoted
On Tue, Jul 14, 2020 at 4:51 PM Lee Jones [off-list ref] wrote:quoted
Can't see them being used anywhere and the compiler doesn't complain that they're missing, so ...Aren't they needed for automatic module loading in certain configurations?Any idea how that works, or where the code is for that?The MODULE_DEVICE_TABLE() thingy creates a map of vendor-id, product-id that the kernel keeps after boot (and so there is no static reference of it for the compiler), later when a device is hotplugged into the kernel it refers to the map to find the related driver for it and loads it if it isn't already loaded. This has some of it, search for MODULE_DEVICE_TABLE() in it. Documentation/driver-api/usb/hotplug.rstAnd you just need to add __maybe_unused to them to suppress the warning.Wouldn't that cause the compiler to optimize them away if it doesn't see any users?It looks like they're only unused when !MODULE,
OK
in which case optimising them away would be the correct thing to do, no?
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel