Skip to contentSkip to conversation

droping a patch in mm

DISCUSSION Henne 3 participants 4 messages Sep 25, 2006 – Sep 26, 2006

Subsystems (8)
lore
Share & tools
lore

Henne

author
#0 lore raw

Hi!

Would you please drop:
pci_module_init_conversion-in-scsi-subsys-2nd-try.patch cause it the moving of libata now it will only produce a lot of errors. I'll rewrite it today.

Thanks,
Henrik Kretzschmar

#1 lore raw
Quoted 6 lines · Henne

Hi!

Would you please drop:
pci_module_init_conversion-in-scsi-subsys-2nd-try.patch cause it the moving of libata now it will only produce a lot of errors. I'll rewrite it today.

And this wrong too in that patch:
- /* Translate error or zero return into zero or one */
- return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
+ return pci_register_driver(&aic7xxx_pci_driver);

regards,

Signature · 4 lines
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E
author
#2 lore raw
Quoted 14 lines
Quoted 6 lines · Jiri Slaby

Henne wrote:
Hi!
Would you please drop:
pci_module_init_conversion-in-scsi-subsys-2nd-try.patch cause it the moving of libata now it will only produce a lot of errors. I'll rewrite it today.

And this wrong too in that patch:

(quoted diff) +1 -2
-    /* Translate error or zero return into zero or one */
-    return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
+    return pci_register_driver(&aic7xxx_pci_driver);
Quoted 1 line

regards,

Acked! But I don't think thats good style to __translate__ return values, even if this one is ignored.
I'll keep it the way it was and just change pci_module_init() into pci_register_driver().

From: Henrik Kretzschmar <[email protected]>

Changes pci_module_init() to pci_register_driver() in the scsi-subsys for drivers which just return the returvalue of that function.

---

 3w-9xxx.c                 |    2 +-
 3w-xxxx.c                 |    2 +-
 a100u2w.c                 |    2 +-
 aic7xxx/aic79xx_osm_pci.c |    2 +-
 aic7xxx/aic7xxx_osm_pci.c |    2 +-
 dc395x.c                  |    2 +-
 dmx3191d.c                |    2 +-
 ipr.c                     |    2 +-
 nsp32.c                   |    2 +-
 qla1280.c                 |    2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)
drivers/scsi/3w-9xxx.c +1 -1
diff -ruN linux-2.6/drivers/scsi/3w-9xxx.c linux-2.6.18-git4/drivers/scsi/3w-9xxx.c
@@ -2211,7 +2211,7 @@
 {
 	printk(KERN_WARNING "3ware 9000 Storage Controller device driver for Linux v%s.\n", TW_DRIVER_VERSION);
 
-	return pci_module_init(&twa_driver);
+	return pci_register_driver(&twa_driver);
 } /* End twa_init() */
 
 /* This function is called on driver exit */
drivers/scsi/3w-xxxx.c +1 -1
diff -ruN linux-2.6/drivers/scsi/3w-xxxx.c linux-2.6.18-git4/drivers/scsi/3w-xxxx.c
@@ -2486,7 +2486,7 @@
 {
 	printk(KERN_WARNING "3ware Storage Controller device driver for Linux v%s.\n", TW_DRIVER_VERSION);
 
-	return pci_module_init(&tw_driver);
+	return pci_register_driver(&tw_driver);
 } /* End tw_init() */
 
 /* This function is called on driver exit */
drivers/scsi/a100u2w.c +1 -1
diff -ruN linux-2.6/drivers/scsi/a100u2w.c linux-2.6.18-git4/drivers/scsi/a100u2w.c
@@ -1187,7 +1187,7 @@
 
 static int __init inia100_init(void)
 {
-	return pci_module_init(&inia100_pci_driver);
+	return pci_register_driver(&inia100_pci_driver);
 }
 
 static void __exit inia100_exit(void)
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +1 -1
diff -ruN linux-2.6/drivers/scsi/aic7xxx/aic79xx_osm_pci.c linux-2.6.18-git4/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -198,7 +198,7 @@
 int
 ahd_linux_pci_init(void)
 {
-	return (pci_module_init(&aic79xx_pci_driver));
+	return pci_register_driver(&aic79xx_pci_driver);
 }
 
 void
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +1 -1
diff -ruN linux-2.6/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c linux-2.6.18-git4/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -247,7 +247,7 @@
 ahc_linux_pci_init(void)
 {
 	/* Translate error or zero return into zero or one */
-	return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
+	return pci_register_driver(&aic7xxx_pci_driver) ? 0 : 1;
 }
 
 void
drivers/scsi/dc395x.c +1 -1
diff -ruN linux-2.6/drivers/scsi/dc395x.c linux-2.6.18-git4/drivers/scsi/dc395x.c
@@ -4949,7 +4949,7 @@
  **/
 static int __init dc395x_module_init(void)
 {
-	return pci_module_init(&dc395x_driver);
+	return pci_register_driver(&dc395x_driver);
 }
 
 
drivers/scsi/dmx3191d.c +1 -1
diff -ruN linux-2.6/drivers/scsi/dmx3191d.c linux-2.6.18-git4/drivers/scsi/dmx3191d.c
@@ -155,7 +155,7 @@
 
 static int __init dmx3191d_init(void)
 {
-	return pci_module_init(&dmx3191d_pci_driver);
+	return pci_register_driver(&dmx3191d_pci_driver);
 }
 
 static void __exit dmx3191d_exit(void)
drivers/scsi/ipr.c +1 -1
diff -ruN linux-2.6/drivers/scsi/ipr.c linux-2.6.18-git4/drivers/scsi/ipr.c
@@ -6749,7 +6749,7 @@
 	ipr_info("IBM Power RAID SCSI Device Driver version: %s %s\n",
 		 IPR_DRIVER_VERSION, IPR_DRIVER_DATE);
 
-	return pci_module_init(&ipr_driver);
+	return pci_register_driver(&ipr_driver);
 }
 
 /**
drivers/scsi/nsp32.c +1 -1
diff -ruN linux-2.6/drivers/scsi/nsp32.c linux-2.6.18-git4/drivers/scsi/nsp32.c
@@ -3581,7 +3581,7 @@
  */
 static int __init init_nsp32(void) {
 	nsp32_msg(KERN_INFO, "loading...");
-	return pci_module_init(&nsp32_driver);
+	return pci_register_driver(&nsp32_driver);
 }
 
 static void __exit exit_nsp32(void) {
drivers/scsi/qla1280.c +1 -1
diff -ruN linux-2.6/drivers/scsi/qla1280.c linux-2.6.18-git4/drivers/scsi/qla1280.c
@@ -4484,7 +4484,7 @@
 		qla1280_setup(qla1280);
 #endif
 
-	return pci_module_init(&qla1280_pci_driver);
+	return pci_register_driver(&qla1280_pci_driver);
 }
 
 static void __exit
#3 lore raw
Quoted 20 lines · On Mon, 25 Sep 2006 12:39:01 +0200 Henne <[email protected]> wrote:
Quoted 14 lines
Quoted 6 lines · Jiri Slaby

Henne wrote:
Hi!
Would you please drop:
pci_module_init_conversion-in-scsi-subsys-2nd-try.patch cause it the moving of libata now it will only produce a lot of errors. I'll rewrite it today.

And this wrong too in that patch:

(quoted diff) +1 -2
-    /* Translate error or zero return into zero or one */
-    return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
+    return pci_register_driver(&aic7xxx_pci_driver);
Quoted 1 line

regards,

Acked! But I don't think thats good style to __translate__ return values, even if this one is ignored.
I'll keep it the way it was and just change pci_module_init() into pci_register_driver().

Quoted 5 lines

From: Henrik Kretzschmar <[email protected]>

Changes pci_module_init() to pci_register_driver() in the scsi-subsys for drivers which just return the returvalue of that function.

Your new patch boils down to this:

drivers/scsi/aic7xxx/aic7xxx_osm_pci.c renamed from drivers/scsi/aic7xxx/aic7xxx_osm_pci.c~pci_module_init-conversion-in-scsi-subsys-2nd-try-update +2 -1
@@ -246,7 +246,8 @@ ahc_linux_pci_dev_probe(struct pci_dev *
 int
 ahc_linux_pci_init(void)
 {
-	return pci_register_driver(&aic7xxx_pci_driver);
+	/* Translate error or zero return into zero or one */
+	return pci_register_driver(&aic7xxx_pci_driver) ? 0 : 1;
 }
 
 void

_

But the earlier verion was better, and ahc_linux_pci_init() has only one caller which cheerfully ignores the error code anyway.

pci_register_driver() is (or will be) marked __must_check. ahc_linux_pci_init() will cunningly suppress that warning, while leaving the driver in an incorrect state.

An appropriate fix would be to teach the rather optimistic ahc_linux_init() about failures.