All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused
@ 2017-05-18  8:32 Arnd Bergmann
  2017-05-18  9:09 ` Arnd Bergmann
  2017-05-24  1:48 ` Martin K. Petersen
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2017-05-18  8:32 UTC (permalink / raw)
  To: Don Brace, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Kevin Barnett, Scott Benesh, Scott Teel,
	esc.storagedev, linux-scsi, linux-kernel

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>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 0b11ae7e96dc..cb8f886e705c 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6213,8 +6213,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;
@@ -6321,8 +6319,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)
 {
@@ -6696,9 +6692,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;
 
@@ -6728,7 +6722,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;
@@ -6759,8 +6753,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[] = {
 	{
-- 
2.9.0

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

* Re: [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused
  2017-05-18  8:32 [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused Arnd Bergmann
@ 2017-05-18  9:09 ` Arnd Bergmann
  2017-05-19  1:53   ` Martin K. Petersen
  2017-05-24  1:48 ` Martin K. Petersen
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2017-05-18  9:09 UTC (permalink / raw)
  To: Don Brace, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Scott Benesh, Scott Teel, esc.storagedev,
	linux-scsi, Linux Kernel Mailing List, Kevin Barnett

On Thu, May 18, 2017 at 10:32 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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>

I notice that today's linux-next no longer contains the patch that introduced
the warning.

     Arnd

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

* Re: [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused
  2017-05-18  9:09 ` Arnd Bergmann
@ 2017-05-19  1:53   ` Martin K. Petersen
  2017-05-22 12:49     ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2017-05-19  1:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Don Brace, James E.J. Bottomley, Martin K. Petersen,
	Scott Benesh, Scott Teel, esc.storagedev, linux-scsi,
	Linux Kernel Mailing List, Kevin Barnett


Arnd,

> I notice that today's linux-next no longer contains the patch that
> introduced the warning.

I had tagged my 4.12 fixes branch with for-next. It should be back to
4.13 material shortly.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused
  2017-05-19  1:53   ` Martin K. Petersen
@ 2017-05-22 12:49     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2017-05-22 12:49 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Don Brace, James E.J. Bottomley, Scott Benesh, Scott Teel,
	esc.storagedev, linux-scsi, Linux Kernel Mailing List,
	Kevin Barnett

On Fri, May 19, 2017 at 3:53 AM, Martin K. Petersen
<martin.petersen@oracle.com> wrote:
>
> Arnd,
>
>> I notice that today's linux-next no longer contains the patch that
>> introduced the warning.
>
> I had tagged my 4.12 fixes branch with for-next. It should be back to
> 4.13 material shortly.

Ok, the patch is back now, so my fix is needed again. Let me know
in case you want me to resend.

        Arnd

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

* Re: [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused
  2017-05-18  8:32 [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused Arnd Bergmann
  2017-05-18  9:09 ` Arnd Bergmann
@ 2017-05-24  1:48 ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2017-05-24  1:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Don Brace, James E.J. Bottomley, Martin K. Petersen,
	Kevin Barnett, Scott Benesh, Scott Teel, esc.storagedev,
	linux-scsi, linux-kernel


Arnd,

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

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

Applied to 4.13/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-05-24  1:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18  8:32 [PATCH] scsi: smartpqi: mark PM functions as __maybe_unused Arnd Bergmann
2017-05-18  9:09 ` Arnd Bergmann
2017-05-19  1:53   ` Martin K. Petersen
2017-05-22 12:49     ` Arnd Bergmann
2017-05-24  1:48 ` 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.