forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thunderbolt: Reduce footprint with CONFIG_PM=n
Add #ifdefs to reduce the Thunderbolt driver's footprint if CONFIG_PM is disabled. I've chosen to also exclude dev_pm_ops structs on such configs as this can be achieved without increasing the LoC count by using a ternary operator. I've left some code untouched which is only relevant with CONFIG_PM=y (e.g. initilization and cancelling of the rescan_work in icm.c) to avoid negatively impacting readability. I've also left pointers in structs which are only relevant with CONFIG_PM=y for the same reason (e.g. the PM function pointers in struct tb_cm_ops) A desired side effect is that the driver's dev_pm_ops callbacks may now access members of struct dev_pm_info which are only available with CONFIG_PM=y. Size of thunderbolt.ko on x86_64 with CONFIG_PM=n: 252832 bytes before, 240912 bytes after Signed-off-by: Lukas Wunner <lukas@wunner.de>
- Loading branch information
Showing
6 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters