Commit 31b17c3a authored by Don Brace's avatar Don Brace Committed by Martin K. Petersen

scsi: smartpqi: Fix unused variable pqi_pm_ops for clang

Driver added a new dev_pm_ops structure used only if CONFIG_PM is set.  The
CONFIG_PM MACRO needed to be moved up in the code to avoid the compiler
warnings. The hunk to move the location was missing from the above patch.

Found by kernel test robot by building driver with CONFIG_PM disabled.

Link: https://lore.kernel.org/all/202202090657.bstNLuce-lkp@intel.com/
Link: https://lore.kernel.org/r/20220210201151.236170-1-don.brace@microchip.com
Fixes: c66e078a ("scsi: smartpqi: Fix hibernate and suspend")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarScott Teel <scott.teel@microchip.com>
Reviewed-by: default avatarScott Benesh <scott.benesh@microchip.com>
Reviewed-by: default avatarMike Mcgowen <mike.mcgowen@microchip.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 26fc0ea7
...@@ -8951,6 +8951,8 @@ static void pqi_process_module_params(void) ...@@ -8951,6 +8951,8 @@ static void pqi_process_module_params(void)
pqi_process_lockup_action_param(); pqi_process_lockup_action_param();
} }
#if defined(CONFIG_PM)
static inline enum bmic_flush_cache_shutdown_event pqi_get_flush_cache_shutdown_event(struct pci_dev *pci_dev) static inline enum bmic_flush_cache_shutdown_event pqi_get_flush_cache_shutdown_event(struct pci_dev *pci_dev)
{ {
if (pci_dev->subsystem_vendor == PCI_VENDOR_ID_ADAPTEC2 && pci_dev->subsystem_device == 0x1304) if (pci_dev->subsystem_vendor == PCI_VENDOR_ID_ADAPTEC2 && pci_dev->subsystem_device == 0x1304)
...@@ -9073,6 +9075,8 @@ static const struct dev_pm_ops pqi_pm_ops = { ...@@ -9073,6 +9075,8 @@ static const struct dev_pm_ops pqi_pm_ops = {
.restore = pqi_resume_or_restore, .restore = pqi_resume_or_restore,
}; };
#endif /* CONFIG_PM */
/* Define the PCI IDs for the controllers that we support. */ /* Define the PCI IDs for the controllers that we support. */
static const struct pci_device_id pqi_pci_id_table[] = { static const struct pci_device_id pqi_pci_id_table[] = {
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment