[PATCH 0/4] HID: remove #ifdef CONFIG_PM

Thomas Weißschuh posted 4 patches 2 years, 2 months ago
drivers/hid/hid-multitouch.c  | 10 +++-------
drivers/hid/hid-rmi.c         | 10 +++-------
drivers/hid/usbhid/hid-core.c | 11 +++--------
include/linux/hid.h           |  4 ++--
4 files changed, 11 insertions(+), 24 deletions(-)
[PATCH 0/4] HID: remove #ifdef CONFIG_PM
Posted by Thomas Weißschuh 2 years, 2 months ago
Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
compiled, protecting against bitrot.
The linker will then garbage-collect the unused function avoiding any overhead.

This series only converts three users of CONFIG_PM in drivers/hid/ but
most of the others should be convertible, too.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (4):
      HID: core: remove #ifdef CONFIG_PM from hid_driver
      HID: usbhid: remove #ifdef CONFIG_PM
      HID: multitouch: remove #ifdef CONFIG_PM
      HID: rmi: remove #ifdef CONFIG_PM

 drivers/hid/hid-multitouch.c  | 10 +++-------
 drivers/hid/hid-rmi.c         | 10 +++-------
 drivers/hid/usbhid/hid-core.c | 11 +++--------
 include/linux/hid.h           |  4 ++--
 4 files changed, 11 insertions(+), 24 deletions(-)
---
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
change-id: 20231012-hid-pm_ptr-e29ab5ee7ce7

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH 0/4] HID: remove #ifdef CONFIG_PM
Posted by Benjamin Tissoires 2 years, 1 month ago
On Thu, 12 Oct 2023 12:23:37 +0200, Thomas Weißschuh wrote:
> Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be
> compiled, protecting against bitrot.
> The linker will then garbage-collect the unused function avoiding any overhead.
> 
> This series only converts three users of CONFIG_PM in drivers/hid/ but
> most of the others should be convertible, too.
> 
> [...]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.7/config_pm), thanks!

[1/4] HID: core: remove #ifdef CONFIG_PM from hid_driver
      https://git.kernel.org/hid/hid/c/df8b030d82dd
[2/4] HID: usbhid: remove #ifdef CONFIG_PM
      https://git.kernel.org/hid/hid/c/f354872108eb
[3/4] HID: multitouch: remove #ifdef CONFIG_PM
      https://git.kernel.org/hid/hid/c/fc2543414c3e
[4/4] HID: rmi: remove #ifdef CONFIG_PM
      https://git.kernel.org/hid/hid/c/eeebfe6259ba

Cheers,
-- 
Benjamin Tissoires <bentiss@kernel.org>