diff mbox

mvumi: fix build warning

Message ID 1457010413-12809-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sudip Mukherjee March 3, 2016, 1:06 p.m. UTC
While building tilepro allmodconfig we were getting build warning:
drivers/scsi/mvumi.c:2632:12: warning: 'mvumi_suspend' defined but not used
drivers/scsi/mvumi.c:2651:12: warning: 'mvumi_resume' defined but not used

mvumi_suspend() and mvumi_resume() are only used when CONFIG_PM is
defined as mentioned in the mvumi_pci_driver.	

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
 drivers/scsi/mvumi.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn March 3, 2016, 1:28 p.m. UTC | #1
On Thu, Mar 03, 2016 at 06:36:53PM +0530, Sudip Mukherjee wrote:
> While building tilepro allmodconfig we were getting build warning:
> drivers/scsi/mvumi.c:2632:12: warning: 'mvumi_suspend' defined but not used
> drivers/scsi/mvumi.c:2651:12: warning: 'mvumi_resume' defined but not used
> 
> mvumi_suspend() and mvumi_resume() are only used when CONFIG_PM is
> defined as mentioned in the mvumi_pci_driver.	
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
>  drivers/scsi/mvumi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
> index 02360de..d9d0736 100644
> --- a/drivers/scsi/mvumi.c
> +++ b/drivers/scsi/mvumi.c
> @@ -2629,6 +2629,7 @@ static void mvumi_shutdown(struct pci_dev *pdev)
>  	mvumi_flush_cache(mhba);
>  }
>  
> +#ifdef CONFIG_PM
>  static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
>  {
>  	struct mvumi_hba *mhba = NULL;
> @@ -2716,6 +2717,7 @@ fail:
>  
>  	return ret;
>  }
> +#endif
>  
>  static struct pci_driver mvumi_pci_driver = {
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

There was a patch from Arnd earlier this day addressing this as well with a
__maybe_unused. You might want to have a look at this one
https://lkml.org/lkml/2016/3/2/497
diff mbox

Patch

diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 02360de..d9d0736 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2629,6 +2629,7 @@  static void mvumi_shutdown(struct pci_dev *pdev)
 	mvumi_flush_cache(mhba);
 }
 
+#ifdef CONFIG_PM
 static int mvumi_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct mvumi_hba *mhba = NULL;
@@ -2716,6 +2717,7 @@  fail:
 
 	return ret;
 }
+#endif
 
 static struct pci_driver mvumi_pci_driver = {