Skip to content

Commit 7dc7c41

Browse files
arndbKalle Valo
authored andcommitted
rtw88: avoid unused function warnings
The rtw88 driver defines emtpy functions with multiple indirections but gets one of these wrong: drivers/net/wireless/realtek/rtw88/pci.c:1347:12: error: 'rtw_pci_resume' defined but not used [-Werror=unused-function] 1347 | static int rtw_pci_resume(struct device *dev) | ^~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw88/pci.c:1342:12: error: 'rtw_pci_suspend' defined but not used [-Werror=unused-function] 1342 | static int rtw_pci_suspend(struct device *dev) Better simplify it to rely on the conditional reference in SIMPLE_DEV_PM_OPS(), and mark the functions as __maybe_unused to avoid warning about it. I'm not sure if these are needed at all given that the functions don't do anything, but they were only recently added. Fixes: 44bc17f ("rtw88: support wowlan feature for 8822c") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c9be1a6 commit 7dc7c41

File tree

1 file changed

+3
-8
lines changed
  • drivers/net/wireless/realtek/rtw88

1 file changed

+3
-8
lines changed

drivers/net/wireless/realtek/rtw88/pci.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,22 +1338,17 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
13381338
rtw_pci_link_cfg(rtwdev);
13391339
}
13401340

1341-
#ifdef CONFIG_PM
1342-
static int rtw_pci_suspend(struct device *dev)
1341+
static int __maybe_unused rtw_pci_suspend(struct device *dev)
13431342
{
13441343
return 0;
13451344
}
13461345

1347-
static int rtw_pci_resume(struct device *dev)
1346+
static int __maybe_unused rtw_pci_resume(struct device *dev)
13481347
{
13491348
return 0;
13501349
}
13511350

13521351
static SIMPLE_DEV_PM_OPS(rtw_pm_ops, rtw_pci_suspend, rtw_pci_resume);
1353-
#define RTW_PM_OPS (&rtw_pm_ops)
1354-
#else
1355-
#define RTW_PM_OPS NULL
1356-
#endif
13571352

13581353
static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev)
13591354
{
@@ -1582,7 +1577,7 @@ static struct pci_driver rtw_pci_driver = {
15821577
.id_table = rtw_pci_id_table,
15831578
.probe = rtw_pci_probe,
15841579
.remove = rtw_pci_remove,
1585-
.driver.pm = RTW_PM_OPS,
1580+
.driver.pm = &rtw_pm_ops,
15861581
};
15871582
module_pci_driver(rtw_pci_driver);
15881583

0 commit comments

Comments
 (0)