All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang
@ 2022-02-10 20:11 Don Brace
  2022-02-11 22:07 ` Martin K. Petersen
  2022-02-15  3:19 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Don Brace @ 2022-02-10 20:11 UTC (permalink / raw)
  To: martin.petersen, linux-scsi
  Cc: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	gerry.morong, mahesh.rajashekhara, mike.mcgowen, murthy.bhat,
	balsundar.p

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/

Correct compiler warning
>> drivers/scsi/smartpqi/smartpqi_init.c:9067:32:
   warning: unused variable 'pqi_pm_ops' [-Wunused-const-variable]
   static const struct dev_pm_ops pqi_pm_ops = {
                                  ^
   1 warning generated.

Fixes: c66e078ad89e ("scsi: smartpqi: Fix hibernate and suspend)"
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike Mcgowen <mike.mcgowen@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 61366642ea95..4611912ae261 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -8951,6 +8951,8 @@ static void pqi_process_module_params(void)
 	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)
 {
 	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 = {
 	.restore = pqi_resume_or_restore,
 };
 
+#endif /* CONFIG_PM */
+
 /* Define the PCI IDs for the controllers that we support. */
 static const struct pci_device_id pqi_pci_id_table[] = {
 	{
-- 
2.28.0.rc1.9.ge7ae437ac1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang
  2022-02-10 20:11 [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang Don Brace
@ 2022-02-11 22:07 ` Martin K. Petersen
  2022-02-15  3:19 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-02-11 22:07 UTC (permalink / raw)
  To: Don Brace
  Cc: martin.petersen, linux-scsi, Kevin.Barnett, scott.teel,
	Justin.Lindley, scott.benesh, gerry.morong, mahesh.rajashekhara,
	mike.mcgowen, murthy.bhat, balsundar.p


Don,

> 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.

Applied to 5.18/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang
  2022-02-10 20:11 [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang Don Brace
  2022-02-11 22:07 ` Martin K. Petersen
@ 2022-02-15  3:19 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-02-15  3:19 UTC (permalink / raw)
  To: linux-scsi, Don Brace
  Cc: Martin K . Petersen, scott.benesh, gerry.morong, mike.mcgowen,
	balsundar.p, murthy.bhat, mahesh.rajashekhara, Kevin.Barnett,
	scott.teel, Justin.Lindley

On Thu, 10 Feb 2022 14:11:51 -0600, Don Brace wrote:

> 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.
> 
> [...]

Applied to 5.18/scsi-queue, thanks!

[1/1] smartpqi: fix unused variable pqi_pm_ops for clang
      https://git.kernel.org/mkp/scsi/c/31b17c3aeb5e

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-15  3:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 20:11 [PATCH] smartpqi: fix unused variable pqi_pm_ops for clang Don Brace
2022-02-11 22:07 ` Martin K. Petersen
2022-02-15  3:19 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.