Skip to contentSkip to conversation

aic7xxx: Fix warnings with CONFIG_PM=n

PATCH In review Frank Lichtenheld 2 participants 7 messages Nov 8, 2007 – Nov 12, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aic7xxx: Fix warnings with CONFIG_PM=n

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

---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |    4 ++++
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +4 -0
index 66f0259..36d7618 100644
@@ -50,8 +50,10 @@ 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);
+#ifdef CONFIG_PM
 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);
+#endif
 static void	ahd_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -96,6 +98,7 @@ static struct pci_driver aic79xx_pci_driver = {
 	.id_table	= ahd_linux_pci_id_table
 };
 
+#ifdef CONFIG_PM
 static int
 ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -139,6 +142,7 @@ ahd_linux_pci_dev_resume(struct pci_dev *pdev)
 
 	return rc;
 }
+#endif
 
 static void
 ahd_linux_pci_dev_remove(struct pci_dev *pdev)
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +4 -0
index 4488946..212c2c8 100644
@@ -49,8 +49,10 @@ 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);
+#ifdef CONFIG_PM
 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);
+#endif
 static void	ahc_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -143,6 +145,7 @@ static struct pci_driver aic7xxx_pci_driver = {
 	.id_table	= ahc_linux_pci_id_table
 };
 
+#ifdef CONFIG_PM
 static int
 ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -182,6 +185,7 @@ ahc_linux_pci_dev_resume(struct pci_dev *pdev)
 
 	return (ahc_resume(ahc));
 }
+#endif
 
 static void
 ahc_linux_pci_dev_remove(struct pci_dev *pdev)
Signature · 6 lines
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Randy Dunlap
Quoted 12 lines · Randy Dunlap

Hi,
The preferred method of fixing this type of warning is to (warning, not a full patch here):

a. change the struct pci_driver not to use #ifdef CONFIG_PM/#endif; instead, it always says:

.suspend = ahd_linux_pci_dev_suspend,
.resume = ahd_linux_pci_dev_resume,

and those pointers are built depending on CONFIG_PM like so:

Quoted 8 lines

#ifdef CONFIG_PM
... functions as they are now ...
#else
#define ahd_linux_pci_dev_suspend NULL
#define ahd_linux_pci_dev_resume NULL
#endif

so the ifdef/endif blocks are localized to one place in each driver.

Hmm, technically _two_ places since you still need them around both declaration and definition of the functions, right?

Gruesse,

Signature · 2 lines
Frank Lichtenheld <[email protected]>
www: http://www.djpig.de/
#1 lore raw
In reply to Frank Lichtenheld
Quoted 9 lines · On Fri, 9 Nov 2007 00:03:48 +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

Quoted 5 lines
---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |    4 ++++
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

Hi,
The preferred method of fixing this type of warning is to (warning, not a full patch here):

a. change the struct pci_driver not to use #ifdef CONFIG_PM/#endif; instead, it always says:

.suspend = ahd_linux_pci_dev_suspend,
.resume = ahd_linux_pci_dev_resume,

and those pointers are built depending on CONFIG_PM like so:

#ifdef CONFIG_PM
... functions as they are now ...
#else
#define ahd_linux_pci_dev_suspend NULL
#define ahd_linux_pci_dev_resume NULL
#endif

so the ifdef/endif blocks are localized to one place in each driver.

Quoted 56 lines
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +4 -0
index 66f0259..36d7618 100644
@@ -50,8 +50,10 @@ 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);
+#ifdef CONFIG_PM
 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);
+#endif
 static void	ahd_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -96,6 +98,7 @@ static struct pci_driver aic79xx_pci_driver = {
 	.id_table	= ahd_linux_pci_id_table
 };
 
+#ifdef CONFIG_PM
 static int
 ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -139,6 +142,7 @@ ahd_linux_pci_dev_resume(struct pci_dev *pdev)
 
 	return rc;
 }
+#endif
 
 static void
 ahd_linux_pci_dev_remove(struct pci_dev *pdev)
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +3 -0
index 4488946..212c2c8 100644
@@ -49,8 +49,10 @@ 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);
+#ifdef CONFIG_PM
 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);
+#endif
 static void	ahc_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -143,6 +145,7 @@ static struct pci_driver aic7xxx_pci_driver = {
 	.id_table	= ahc_linux_pci_id_table
 };
 
+#ifdef CONFIG_PM
 static int
 ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {

drivers/scsi/aic7xxx/aic7xxx_osm_pci.c ahc_linux_pci_dev_resume(struct pci_dev *pdev) · line 191

Quoted 7 lines
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +1 -0
@@ -182,6 +185,7 @@ ahc_linux_pci_dev_resume(struct pci_dev *pdev)
 
 	return (ahc_resume(ahc));
 }
+#endif
 
 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Frank Lichtenheld
Quoted 20 lines · Frank Lichtenheld
Quoted 19 lines · Randy Dunlap

Hi,
The preferred method of fixing this type of warning is to (warning, not a full patch here):

a. change the struct pci_driver not to use #ifdef CONFIG_PM/#endif; instead, it always says:

.suspend = ahd_linux_pci_dev_suspend,
.resume = ahd_linux_pci_dev_resume,

and those pointers are built depending on CONFIG_PM like so:

#ifdef CONFIG_PM
... functions as they are now ...
#else
#define ahd_linux_pci_dev_suspend NULL
#define ahd_linux_pci_dev_resume NULL
#endif

Quoted 4 lines
Quoted 1 line

so the ifdef/endif blocks are localized to one place in each driver.

Hmm, technically _two_ places since you still need them around both declaration and definition of the functions, right?

OK, that's the case without any code movement.
But "ideally" the functions would be defined before the struct pci_driver data, so the prototypes for them could be removed.

Signature · 1 line
~Randy
#4 lore raw

PATCH 1/1 aic7xxx: Fix warnings with CONFIG_PM=n

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

---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +++++++++++++------------
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +++++++++++++------------
 2 files changed, 26 insertions(+), 24 deletions(-)
Quoted 2 lines

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.

drivers/scsi/aic7xxx/aic79xx_osm_pci.c +13 -12
index 66f0259..f6dbd3e 100644
@@ -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)
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +13 -12
index 4488946..ab53189 100644
@@ -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)
Signature · 6 lines
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#5 lore raw
Quoted 9 lines · 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

Quoted 5 lines

Reorder code as suggested by Randy Dunlap to minimize needed #ifdefs

Thanks.

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

Quoted 104 lines
---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +++++++++++++------------
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +++++++++++++------------
 2 files changed, 26 insertions(+), 24 deletions(-)
Quoted 2 lines

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.

drivers/scsi/aic7xxx/aic79xx_osm_pci.c +13 -12
index 66f0259..f6dbd3e 100644
@@ -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)
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +6 -12
index 4488946..ab53189 100644
@@ -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 = {

drivers/scsi/aic7xxx/aic7xxx_osm_pci.c ahc_linux_pci_dev_resume(struct pci_dev *pdev) · line 188

Quoted 10 lines
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +7 -0
+	.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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

PATCH 1/1 aic7xxx: Fix warnings with CONFIG_PM=n

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

---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +++++++++++++------------
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +++++++++++++------------
 2 files changed, 26 insertions(+), 24 deletions(-)
Quoted 3 lines

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

fixed

drivers/scsi/aic7xxx/aic79xx_osm_pci.c +13 -12
index 66f0259..2b7c9a9 100644
@@ -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)
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +13 -12
index 4488946..d10553e 100644
@@ -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)
Signature · 6 lines
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html