public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Frank Lichtenheld <frank@lichtenheld.de>
Cc: Hannes Reinecke <hare@suse.de>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH alternative] [SCSI] aic7xxx: Fix warnings with CONFIG_PM=n
Date: Fri, 9 Nov 2007 08:17:51 -0800	[thread overview]
Message-ID: <20071109081751.9438e82d.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1194594944-14277-1-git-send-email-frank@lichtenheld.de>

On Fri,  9 Nov 2007 08:55:44 +0100 Frank Lichtenheld wrote:

> Fixes the following warnings:
>   CC [M]  drivers/scsi/aic7xxx/aic79xx_osm_pci.o
> drivers/scsi/aic7xxx/aic79xx_osm_pci.c:101: warning: ‘ahd_linux_pci_dev_suspend’ defined but not used
> drivers/scsi/aic7xxx/aic79xx_osm_pci.c:121: warning: ‘ahd_linux_pci_dev_resume’ defined but not used
> 
>   CC [M]  drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
> drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:148: warning: ‘ahc_linux_pci_dev_suspend’ defined but not used
> drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:166: warning: ‘ahc_linux_pci_dev_resume’ defined but not used
> 
> Reorder code as suggested by Randy Dunlap to minimize
> needed #ifdefs
> 
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>

Thanks.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

with one nit:

Warning: trailing whitespace in line 174 of drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
Warning: trailing whitespace in lines 131,132 of drivers/scsi/aic7xxx/aic79xx_osm_pci.c

> ---
>  drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +++++++++++++------------
>  drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +++++++++++++------------
>  2 files changed, 26 insertions(+), 24 deletions(-)
> 
>  > But "ideally" the functions would be defined before the                  
>  > struct pci_driver data, so the prototypes for them could be removed.
> 
>  Hmm, I'm a bit sceptical about the reordering, but here you go.
>  Choose whatever you like.
> 
> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
> index 66f0259..f6dbd3e 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
> @@ -50,8 +50,6 @@ static int	ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd,
>  static int	ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd,
>  						 u_long *bus_addr,
>  						 uint8_t __iomem **maddr);
> -static int	ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg);
> -static int	ahd_linux_pci_dev_resume(struct pci_dev *pdev);
>  static void	ahd_linux_pci_dev_remove(struct pci_dev *pdev);
>  
>  /* Define the macro locally since it's different for different class of chips.
> @@ -85,17 +83,7 @@ static struct pci_device_id ahd_linux_pci_id_table[] = {
>  
>  MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table);
>  
> -static struct pci_driver aic79xx_pci_driver = {
> -	.name		= "aic79xx",
> -	.probe		= ahd_linux_pci_dev_probe,
>  #ifdef CONFIG_PM
> -	.suspend	= ahd_linux_pci_dev_suspend,
> -	.resume		= ahd_linux_pci_dev_resume,
> -#endif
> -	.remove		= ahd_linux_pci_dev_remove,
> -	.id_table	= ahd_linux_pci_id_table
> -};
> -
>  static int
>  ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
>  {
> @@ -139,6 +127,19 @@ ahd_linux_pci_dev_resume(struct pci_dev *pdev)
>  
>  	return rc;
>  }
> +#else
> +#define ahd_linux_pci_dev_suspend     NULL                                                                                                                 
> +#define ahd_linux_pci_dev_resume      NULL 
> +#endif
> +
> +static struct pci_driver aic79xx_pci_driver = {
> +	.name		= "aic79xx",
> +	.probe		= ahd_linux_pci_dev_probe,
> +	.suspend	= ahd_linux_pci_dev_suspend,
> +	.resume		= ahd_linux_pci_dev_resume,
> +	.remove		= ahd_linux_pci_dev_remove,
> +	.id_table	= ahd_linux_pci_id_table
> +};
>  
>  static void
>  ahd_linux_pci_dev_remove(struct pci_dev *pdev)
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
> index 4488946..ab53189 100644
> --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
> +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
> @@ -49,8 +49,6 @@ static int	ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc,
>  static int	ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
>  						 u_long *bus_addr,
>  						 uint8_t __iomem **maddr);
> -static int	ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg);
> -static int	ahc_linux_pci_dev_resume(struct pci_dev *pdev);
>  static void	ahc_linux_pci_dev_remove(struct pci_dev *pdev);
>  
>  /* Define the macro locally since it's different for different class of chips.
> @@ -132,17 +130,7 @@ static struct pci_device_id ahc_linux_pci_id_table[] = {
>  
>  MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
>  
> -static struct pci_driver aic7xxx_pci_driver = {
> -	.name		= "aic7xxx",
> -	.probe		= ahc_linux_pci_dev_probe,
>  #ifdef CONFIG_PM
> -	.suspend	= ahc_linux_pci_dev_suspend,
> -	.resume		= ahc_linux_pci_dev_resume,
> -#endif
> -	.remove		= ahc_linux_pci_dev_remove,
> -	.id_table	= ahc_linux_pci_id_table
> -};
> -
>  static int
>  ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
>  {
> @@ -182,6 +170,19 @@ ahc_linux_pci_dev_resume(struct pci_dev *pdev)
>  
>  	return (ahc_resume(ahc));
>  }
> +#else
> +#define ahc_linux_pci_dev_suspend     NULL                                                                                                                
> +#define ahc_linux_pci_dev_resume      NULL
> +#endif
> +
> +static struct pci_driver aic7xxx_pci_driver = {
> +	.name		= "aic7xxx",
> +	.probe		= ahc_linux_pci_dev_probe,
> +	.suspend	= ahc_linux_pci_dev_suspend,
> +	.resume		= ahc_linux_pci_dev_resume,
> +	.remove		= ahc_linux_pci_dev_remove,
> +	.id_table	= ahc_linux_pci_id_table
> +};
>  
>  static void
>  ahc_linux_pci_dev_remove(struct pci_dev *pdev)
> -- 

---
~Randy
-
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

  reply	other threads:[~2007-11-09 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 23:03 [PATCH] [SCSI] aic7xxx: Fix warnings with CONFIG_PM=n Frank Lichtenheld
2007-11-08 23:58 ` Randy Dunlap
2007-11-09  0:12   ` Frank Lichtenheld
2007-11-09  0:17     ` Randy Dunlap
2007-11-09  7:55       ` [PATCH alternative] " Frank Lichtenheld
2007-11-09 16:17         ` Randy Dunlap [this message]
2007-11-12 10:23           ` [PATCH] " Frank Lichtenheld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071109081751.9438e82d.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=frank@lichtenheld.de \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox