Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: smartpqi: mark PM functions as __maybe_unused

The newly added suspend/resume support causes harmless warnings when
CONFIG_PM is disabled:

smartpqi/smartpqi_init.c:5147:12: error: 'pqi_ctrl_wait_for_pending_io' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2019:13: error: 'pqi_wait_until_lun_reset_finished' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2013:13: error: 'pqi_wait_until_scan_finished' defined but not used [-Werror=unused-function]

We can avoid the warnings by removing the #ifdef around the handlers and
instead marking them as __maybe_unused, which will let gcc drop the
unused code silently.

Fixes: f44d210312a6 ("scsi: smartpqi: add suspend and resume support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Arnd Bergmann and committed by
Martin K. Petersen
5c146686 42c335f7

+2 -10
+2 -10
drivers/scsi/smartpqi/smartpqi_init.c
··· 6213 6213 return 0; 6214 6214 } 6215 6215 6216 - #if defined(CONFIG_PM) 6217 - 6218 6216 static void pqi_reinit_queues(struct pqi_ctrl_info *ctrl_info) 6219 6217 { 6220 6218 unsigned int i; ··· 6318 6320 6319 6321 return 0; 6320 6322 } 6321 - 6322 - #endif /* CONFIG_PM */ 6323 6323 6324 6324 static inline int pqi_set_pcie_completion_timeout(struct pci_dev *pci_dev, 6325 6325 u16 timeout) ··· 6692 6696 pqi_process_lockup_action_param(); 6693 6697 } 6694 6698 6695 - #if defined(CONFIG_PM) 6696 - 6697 - static int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state) 6699 + static __maybe_unused int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state) 6698 6700 { 6699 6701 struct pqi_ctrl_info *ctrl_info; 6700 6702 ··· 6722 6728 return 0; 6723 6729 } 6724 6730 6725 - static int pqi_resume(struct pci_dev *pci_dev) 6731 + static __maybe_unused int pqi_resume(struct pci_dev *pci_dev) 6726 6732 { 6727 6733 int rc; 6728 6734 struct pqi_ctrl_info *ctrl_info; ··· 6752 6758 6753 6759 return pqi_ctrl_init_resume(ctrl_info); 6754 6760 } 6755 - 6756 - #endif /* CONFIG_PM */ 6757 6761 6758 6762 /* Define the PCI IDs for the controllers that we support. */ 6759 6763 static const struct pci_device_id pqi_pci_id_table[] = {