]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: smartpqi: mark PM functions as __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Thu, 18 May 2017 08:32:18 +0000 (10:32 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 26 Jul 2017 04:07:04 +0000 (21:07 -0700)
Orabug: 2619102126447813

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>
(cherry picked from commit 5c146686e32085e76ad9e2957f3dee9b28fe4f22)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/smartpqi/smartpqi_init.c

index c91508ce545dbc9ae575effa2adc1f6c6962810a..d7220faba1d80230f5bd74abb95866d6171fae2a 100644 (file)
@@ -6249,8 +6249,6 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
        return 0;
 }
 
-#if defined(CONFIG_PM)
-
 static void pqi_reinit_queues(struct pqi_ctrl_info *ctrl_info)
 {
        unsigned int i;
@@ -6357,8 +6355,6 @@ static int pqi_ctrl_init_resume(struct pqi_ctrl_info *ctrl_info)
        return 0;
 }
 
-#endif /* CONFIG_PM */
-
 static inline int pqi_set_pcie_completion_timeout(struct pci_dev *pci_dev,
        u16 timeout)
 {
@@ -6734,9 +6730,7 @@ static void pqi_process_module_params(void)
        pqi_process_lockup_action_param();
 }
 
-#if defined(CONFIG_PM)
-
-static int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state)
+static __maybe_unused int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state)
 {
        struct pqi_ctrl_info *ctrl_info;
 
@@ -6766,7 +6760,7 @@ static int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state)
        return 0;
 }
 
-static int pqi_resume(struct pci_dev *pci_dev)
+static __maybe_unused int pqi_resume(struct pci_dev *pci_dev)
 {
        int rc;
        struct pqi_ctrl_info *ctrl_info;
@@ -6797,8 +6791,6 @@ static int pqi_resume(struct pci_dev *pci_dev)
        return pqi_ctrl_init_resume(ctrl_info);
 }
 
-#endif /* CONFIG_PM */
-
 /* Define the PCI IDs for the controllers that we support. */
 static const struct pci_device_id pqi_pci_id_table[] = {
        {