Skip to contentSkip to conversation

fix usage of __{,dev}exit_p

PATCH New Uwe Kleine-König 12 participants 65 messages Oct 1, 2009 – Oct 6, 2009

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

cover fix usage of __{,dev}exit_p

Hello,

I already sent a similar series in January[1]. Apart from a general Ack by Sam there was no reaction.

Now that there exists scripts/get_maintainer.pl, I resend an updated series to an wider audience in the hope to get more feedback.

Best regards
Uwe

[1] http://thread.gmane.org/gmane.linux.kernel/779241

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#1 lore raw

PATCH 1/34 move asic3_remove to .devexit.text

The function asic3_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/mfd/asic3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/asic3.c +1 -1
index 63a2a66..e22128c 100644
@@ -908,7 +908,7 @@ static int __init asic3_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int asic3_remove(struct platform_device *pdev)
+static int __devexit asic3_remove(struct platform_device *pdev)
 {
 	int ret;
 	struct asic3 *asic = platform_get_drvdata(pdev);
Signature · 1 line
1.6.4.3
Applied
#2 lore raw

Re: [PATCH 01/34] move asic3_remove to .devexit.text

Hi Uwe,

Quoted 2 lines · Uwe Kleine-König

The function asic3_remove is used only wrapped by __devexit_p so define it using __devexit.

Applied to the mfd tree, thanks.

Cheers,
Samuel.

Quoted 27 lines
---
 drivers/mfd/asic3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/asic3.c +1 -1
index 63a2a66..e22128c 100644
@@ -908,7 +908,7 @@ static int __init asic3_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int asic3_remove(struct platform_device *pdev)
+static int __devexit asic3_remove(struct platform_device *pdev)
 {
 	int ret;
 	struct asic3 *asic = platform_get_drvdata(pdev);
Signature · 1 line
1.6.4.3
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#3 lore raw

PATCH 2/34 move atp870u_remove to .devexit.text

In reply to Uwe Kleine-König

The function atp870u_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/scsi/atp870u.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/atp870u.c +1 -1
index b137e56..1059167 100644
@@ -3143,7 +3143,7 @@ static int atp870u_biosparam(struct scsi_device *disk, struct block_device *dev,
 	return 0;
 }
 
-static void atp870u_remove (struct pci_dev *pdev)
+static void __devexit atp870u_remove (struct pci_dev *pdev)
 {	
 	struct atp_unit *devext = pci_get_drvdata(pdev);
 	struct Scsi_Host *pshost = devext->host;
Signature · 1 line
1.6.4.3
#4 lore raw

Re: [PATCH 02/34] move atp870u_remove to .devexit.text

Quoted 2 lines · Uwe Kleine-König

The function atp870u_remove is used only wrapped by __devexit_p so define it using __devexit.

What's the justification for this?

Given that practically every kernel on the planet is hotplug enabled these days and that the savings on the very few that aren't from discarding the devexit section is at most a page or two (and even arm says they don't care about that), there doesn't seem to be any point making these changes. In fact, I think we can just kill devinit and devexit as section markers.

James

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

#5 lore raw

Re: [PATCH 02/34] move atp870u_remove to .devexit.text

Hello,

Quoted 6 lines · James Bottomley

Given that practically every kernel on the planet is hotplug enabled these days and that the savings on the very few that aren't from discarding the devexit section is at most a page or two (and even arm says they don't care about that), there doesn't seem to be any point making these changes. In fact, I think we can just kill devinit and devexit as section markers.

IMHO you should better kill CONFIG_HOTPLUG completely then.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#6 lore raw

PATCH 3/34 move bbc_remove to .devexit.text

In reply to Uwe Kleine-König

The function bbc_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/input/misc/sparcspkr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/misc/sparcspkr.c +1 -1
index c4f4231..5399dd2 100644
@@ -230,7 +230,7 @@ out_err:
 	return err;
 }
 
-static int bbc_remove(struct of_device *op)
+static int __devexit bbc_remove(struct of_device *op)
 {
 	struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
 	struct input_dev *input_dev = state->input_dev;
Signature · 1 line
1.6.4.3
#7 lore raw

PATCH 4/34 don't use __devexit_p to wrap excite_nand_remove

In reply to Uwe Kleine-König

The function excite_nand_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc Ming Lei <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David Brownell <[email protected]>
---
 drivers/mtd/nand/excite_nandflash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/excite_nandflash.c +1 -1
index 72446fb..630b4d6 100644
@@ -224,7 +224,7 @@ static struct platform_driver excite_nand_driver = {
 		.owner		= THIS_MODULE,
 	},
 	.probe = excite_nand_probe,
-	.remove = __devexit_p(excite_nand_remove)
+	.remove = __exit_p(excite_nand_remove)
 };
 
 static int __init excite_nand_init(void)
Signature · 1 line
1.6.4.3
#8 lore raw

PATCH 5/34 move grover_remove to .devexit.text

In reply to Uwe Kleine-König

The function grover_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/input/misc/sparcspkr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/misc/sparcspkr.c +1 -1
index 5399dd2..b064419 100644
@@ -308,7 +308,7 @@ out_err:
 	return err;
 }
 
-static int grover_remove(struct of_device *op)
+static int __devexit grover_remove(struct of_device *op)
 {
 	struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
 	struct grover_beep_info *info = &state->u.grover;
Signature · 1 line
1.6.4.3
#10 lore raw

PATCH 6/34 don't use __devexit_p to wrap hal2_remove

In reply to Uwe Kleine-König

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

---
 sound/mips/hal2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/mips/hal2.c +1 -1
index c52691c..72523a7 100644
@@ -926,7 +926,7 @@ static int __exit hal2_remove(struct platform_device *pdev)
 
 static struct platform_driver hal2_driver = {
 	.probe	= hal2_probe,
-	.remove	= __devexit_p(hal2_remove),
+	.remove	= __exit_p(hal2_remove),
 	.driver = {
 		.name	= "sgihal2",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3
#11 lore raw

Re: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

At Thu, 1 Oct 2009 10:28:10 +0200,

Quoted 3 lines · Uwe Kleine-König

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

I think it's the other way round. We should replace __exit with __devexit. Ditto for sound/mips/sgio2audio.c.

thanks,

Takashi

Quoted 26 lines
---
 sound/mips/hal2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/mips/hal2.c +1 -1
index c52691c..72523a7 100644
@@ -926,7 +926,7 @@ static int __exit hal2_remove(struct platform_device *pdev)
 
 static struct platform_driver hal2_driver = {
 	.probe	= hal2_probe,
-	.remove	= __devexit_p(hal2_remove),
+	.remove	= __exit_p(hal2_remove),
 	.driver = {
 		.name	= "sgihal2",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#12 lore raw

Re: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

Quoted 8 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:28:10 +0200,

Quoted 3 lines · Uwe Kleine-König

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

I think it's the other way round. We should replace __exit with __devexit. Ditto for sound/mips/sgio2audio.c.

Actually both ways are possible. I choosed the alternative that doesn't add bloat to the kernel. The cost is that the device isn't hotplugable, but you can still unload the module to unbind the driver.

I don't care much, but prefer slightly my approach as changing the patch is work for me :-)

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#13 lore raw

Re: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

At Thu, 1 Oct 2009 10:53:55 +0200,

Quoted 5 lines · Uwe Kleine-König
Quoted 3 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:28:10 +0200,

Quoted 1 line · Uwe Kleine-König
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

I think it's the other way round. We should replace __exit with __devexit. Ditto for sound/mips/sgio2audio.c.

Actually both ways are possible. I choosed the alternative that doesn't add bloat to the kernel. The cost is that the device isn't hotplugable, but you can still unload the module to unbind the driver.

Hm, is it really safe to set remove=NULL although the driver needs some work at unbinding? It looks like that unbind is allowed no matter whether remove is NULL or not. So, it would jus keeps stray resources, and it might conflict at the next bind.

Quoted 2 lines

I don't care much, but prefer slightly my approach as changing the patch is work for me :-)

I prefer rather symmetry and safety :)
I'm going to change to __devexit.

thanks,

Takashi

#14 lore raw

Re: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

Hello,

Quoted 12 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:53:55 +0200,

Quoted 10 lines · Uwe Kleine-König
Quoted 8 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:28:10 +0200,

Quoted 3 lines · Uwe Kleine-König

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

I think it's the other way round. We should replace __exit with __devexit. Ditto for sound/mips/sgio2audio.c.

Quoted 8 lines
Quoted 3 lines

Actually both ways are possible. I choosed the alternative that doesn't add bloat to the kernel. The cost is that the device isn't hotplugable, but you can still unload the module to unbind the driver.

Hm, is it really safe to set remove=NULL although the driver needs some work at unbinding? It looks like that unbind is allowed no matter whether remove is NULL or not. So, it would jus keeps stray resources, and it might conflict at the next bind.

I just tried that and you're right. IMHO that's a bug. Greg?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#15 lore raw

Re: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

At Fri, 2 Oct 2009 11:20:25 +0200,

Quoted 20 lines · Uwe Kleine-König

Hello,

Quoted 16 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:53:55 +0200,

Quoted 13 lines · Uwe Kleine-König
Quoted 8 lines · Takashi Iwai

At Thu, 1 Oct 2009 10:28:10 +0200,

Quoted 3 lines · Uwe Kleine-König

The function hal2_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

I think it's the other way round. We should replace __exit with __devexit. Ditto for sound/mips/sgio2audio.c.

Actually both ways are possible. I choosed the alternative that doesn't add bloat to the kernel. The cost is that the device isn't hotplugable, but you can still unload the module to unbind the driver.

Quoted 5 lines
Quoted 4 lines

Hm, is it really safe to set remove=NULL although the driver needs some work at unbinding? It looks like that unbind is allowed no matter whether remove is NULL or not. So, it would jus keeps stray resources, and it might conflict at the next bind.

I just tried that and you're right. IMHO that's a bug. Greg?

I suppose it's a bug of the driver, not the core :)
If the driver doesn't need to release resources, it would work fine with remove = NULL. Also, the bus can provide a common remove callback (even it's over the driver's remove callback). So, in theory, it can be NULL.

But, it must be really rare, and non-NULL remove is very likely a bug if the driver is built with CONFIG_HOTPLUG=y...

thanks,

Takashi

#16 lore raw

PATCH 7/34 move ilo_remove to .devexit.text

In reply to Uwe Kleine-König

The function ilo_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/misc/hpilo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/hpilo.c +1 -1
index 1ad27c6..9ec007e 100644
@@ -715,7 +715,7 @@ out:
 	return error;
 }
 
-static void ilo_remove(struct pci_dev *pdev)
+static void __devexit ilo_remove(struct pci_dev *pdev)
 {
 	int i, minor;
 	struct ilo_hwinfo *ilo_hw = pci_get_drvdata(pdev);
Signature · 1 line
1.6.4.3
Acked-by on v1 7/34
#17 lore raw

RE: [PATCH 07/34] move ilo_remove to .devexit.text

Quoted 3 lines

The function ilo_remove is used only wrapped by __devexit_p so define it using __devexit.

Looks good to me. Not sure if this is needed or not...

���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#18 lore raw

Re: [PATCH 07/34] move ilo_remove to .devexit.text

Hello David,

Quoted 4 lines · David
Quoted 2 lines

The function ilo_remove is used only wrapped by __devexit_p so define it using __devexit.

Looks good to me. Not sure if this is needed or not...

it fixes at least a warning if you compile the driver as built-in with CONFIG_HOTPLUG=n about ilo_remove not being used.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#19 lore raw

RE: [PATCH 07/34] move ilo_remove to .devexit.text

Quoted 2 lines
Quoted 1 line

Looks good to me. Not sure if this is needed or not...

it fixes at least a warning

Sorry for any confusion, I was referring to my specific Acked-by, I didn't know if you needed that from me.

#20 lore raw

PATCH 8/34 move initio_remove_one to .devexit.text

In reply to Uwe Kleine-König

The function initio_remove_one is used only wrapped by __devexit_p so define it using __devexit.

Cc James E.J. Bottomley <[email protected]>
Cc Yang Hongyang <[email protected]>
Cc James Bottomley <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Alan Cox <[email protected]>
---
 drivers/scsi/initio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/initio.c +1 -1
index 89a5948..8bbfd99 100644
@@ -2964,7 +2964,7 @@ out_disable_device:
  *	finished being used.
  */
 
-static void initio_remove_one(struct pci_dev *pdev)
+static void __devexit initio_remove_one(struct pci_dev *pdev)
 {
 	struct Scsi_Host *host = pci_get_drvdata(pdev);
 	struct initio_host *s = (struct initio_host *)host->hostdata;
Signature · 1 line
1.6.4.3
#21 lore raw

PATCH 9/34 don't use __devexit_p to wrap iodev_remove

In reply to Uwe Kleine-König

The function iodev_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc Ming Lei <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David Brownell <[email protected]>
---
 arch/mips/basler/excite/excite_iodev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/basler/excite/excite_iodev.c +1 -1
index 938b1d0..5351b91 100644
@@ -71,7 +71,7 @@ static struct platform_driver iodev_driver = {
 		.owner		= THIS_MODULE,
 	},
 	.probe		= iodev_probe,
-	.remove		= __devexit_p(iodev_remove),
+	.remove		= __exit_p(iodev_remove),
 };
 
 
Signature · 1 line
1.6.4.3
#22 lore raw

PATCH 10/34 don't use __devexit_p to wrap lasi700_driver_remove

In reply to Uwe Kleine-König

The function lasi700_driver_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc James E.J. Bottomley <[email protected]>
Cc Yang Hongyang <[email protected]>
Cc Kyle McMartin <[email protected]>
Cc Kay Sievers <[email protected]>
Cc James Bottomley <[email protected]>
---
 drivers/scsi/lasi700.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/lasi700.c +1 -1
index b3d3131..2991c81 100644
@@ -167,7 +167,7 @@ static struct parisc_driver lasi700_driver = {
 	.name =		"lasi_scsi",
 	.id_table =	lasi700_ids,
 	.probe =	lasi700_probe,
-	.remove =	__devexit_p(lasi700_driver_remove),
+	.remove =	__exit_p(lasi700_driver_remove),
 };
 
 static int __init
Signature · 6 lines
1.6.4.3

--
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
#23 lore raw

PATCH 11/34 move mcf_remove to .devexit.text

In reply to Uwe Kleine-König

The function mcf_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Greg Ungerer <[email protected]>
Cc Len Sorensen <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Alan Cox <[email protected]>
---
 drivers/serial/mcf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/mcf.c +1 -1
index b443824..7bb5fee 100644
@@ -602,7 +602,7 @@ static int __devinit mcf_probe(struct platform_device *pdev)
 
 /****************************************************************************/
 
-static int mcf_remove(struct platform_device *pdev)
+static int __devexit mcf_remove(struct platform_device *pdev)
 {
 	struct uart_port *port;
 	int i;
Signature · 1 line
1.6.4.3
#24 lore raw

Re: [PATCH 11/34] move mcf_remove to .devexit.text

Hi Uwe,

Quoted 18 lines · Uwe Kleine-König

The function mcf_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Greg Ungerer <[email protected]>
Cc Len Sorensen <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Alan Cox <[email protected]>
---
 drivers/serial/mcf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/mcf.c +0 -0
index b443824..7bb5fee 100644

drivers/serial/mcf.c static int __devinit mcf_probe(struct platform_device *pdev) · line 608

Quoted 8 lines
drivers/serial/mcf.c +1 -1
@@ -602,7 +602,7 @@ static int __devinit mcf_probe(struct platform_device *pdev)
 
 /****************************************************************************/
 
-static int mcf_remove(struct platform_device *pdev)
+static int __devexit mcf_remove(struct platform_device *pdev)
 {
 	struct uart_port *port;
 	int i;

Looks good. I'll add that to the m68knommu git, for-linus branch.

Thanks
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#25 lore raw

PATCH 12/34 move megaraid_detach_one to .devexit.text

In reply to Uwe Kleine-König

The function megaraid_detach_one is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/scsi/megaraid/megaraid_mbox.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_mbox.c +2 -2
index 234f0b7..9fc9cf7 100644
@@ -76,7 +76,7 @@ static int megaraid_init(void);
 static void megaraid_exit(void);
 
 static int megaraid_probe_one(struct pci_dev*, const struct pci_device_id *);
-static void megaraid_detach_one(struct pci_dev *);
+static void __devexit megaraid_detach_one(struct pci_dev *);
 static void megaraid_mbox_shutdown(struct pci_dev *);
 
 static int megaraid_io_attach(adapter_t *);
@@ -551,7 +551,7 @@ out_probe_one:
  *
  * This routine is also called from the PCI hotplug system.
  */
-static void
+static void __devexit
 megaraid_detach_one(struct pci_dev *pdev)
 {
 	adapter_t		*adapter;
Signature · 6 lines
1.6.4.3

--
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
#26 lore raw

PATCH 13/34 don't use __devexit_p to wrap meth_remove

In reply to Uwe Kleine-König

The function meth_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc David S. Miller <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Patrick McHardy <[email protected]>
Cc Johannes Berg <[email protected]>
---
 drivers/net/meth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/meth.c +1 -1
index 92ceb68..2af8173 100644
@@ -828,7 +828,7 @@ static int __exit meth_remove(struct platform_device *pdev)
 
 static struct platform_driver meth_driver = {
 	.probe	= meth_probe,
-	.remove	= __devexit_p(meth_remove),
+	.remove	= __exit_p(meth_remove),
 	.driver = {
 		.name	= "meth",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3
#27 lore raw

PATCH 14/34 don't wrap mlx4_remove_one in __devexit_p

In reply to Uwe Kleine-König

The function mlx4_remove_one is defined in .text, so there is no need to wrap it with __devexit_p.

Cc Roland Dreier <[email protected]>
Cc Yevgeny Petrilin <[email protected]>
Cc Yang Hongyang <[email protected]>
Cc Jack Morgenstein <[email protected]>
Cc Eli Cohen <[email protected]>
---
 drivers/net/mlx4/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/main.c +1 -1
index 3dd481e..00625a7 100644
@@ -1291,7 +1291,7 @@ static struct pci_driver mlx4_driver = {
 	.name		= DRV_NAME,
 	.id_table	= mlx4_pci_table,
 	.probe		= mlx4_init_one,
-	.remove		= __devexit_p(mlx4_remove_one)
+	.remove		= mlx4_remove_one
 };
 
 static int __init mlx4_verify_params(void)
Signature · 1 line
1.6.4.3
#28 lore raw

PATCH 15/34 move mpc85xx_pci_err_remove to .devexit.text

In reply to Uwe Kleine-König

The function mpc85xx_pci_err_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/edac/mpc85xx_edac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/edac/mpc85xx_edac.c +1 -1
index 157f650..ce6d759 100644
@@ -304,7 +304,7 @@ err:
 	return res;
 }
 
-static int mpc85xx_pci_err_remove(struct of_device *op)
+static int __devexit mpc85xx_pci_err_remove(struct of_device *op)
 {
 	struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev);
 	struct mpc85xx_pci_pdata *pdata = pci->pvt_info;
Signature · 1 line
1.6.4.3
#29 lore raw

PATCH 16/34 move mv64x60_pci_err_remove to .devexit.text

In reply to Uwe Kleine-König

The function mv64x60_pci_err_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/edac/mv64x60_edac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/edac/mv64x60_edac.c +1 -1
index a6b9fec..ed25d73 100644
@@ -206,7 +206,7 @@ err:
 	return res;
 }
 
-static int mv64x60_pci_err_remove(struct platform_device *pdev)
+static int __devexit mv64x60_pci_err_remove(struct platform_device *pdev)
 {
 	struct edac_pci_ctl_info *pci = platform_get_drvdata(pdev);
 
Signature · 1 line
1.6.4.3
#30 lore raw

PATCH 17/34 move mxcnd_remove to .exit.text

In reply to Uwe Kleine-König

The function mxcnd_remove is used only wrapped by __exit_p so define it using __exit.

Cc David Woodhouse <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Artem Bityutskiy <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Vladimir Barinov <[email protected]>
Cc Vladimir Barinov <[email protected]>
---
 drivers/mtd/nand/mxc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/mxc_nand.c +1 -1
index 65b26d5..ef3e199 100644
@@ -1052,7 +1052,7 @@ eclk:
 	return err;
 }
 
-static int __devexit mxcnd_remove(struct platform_device *pdev)
+static int __exit mxcnd_remove(struct platform_device *pdev)
 {
 	struct mxc_nand_host *host = platform_get_drvdata(pdev);
 
Signature · 1 line
1.6.4.3
#31 lore raw

PATCH 18/34 don't use __devexit_p to wrap NCR_Q720_remove

In reply to Uwe Kleine-König

The function NCR_Q720_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

---
 drivers/scsi/NCR_Q720.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/NCR_Q720.c +1 -1
index a8bbdc2..572042f 100644
@@ -350,7 +350,7 @@ static struct mca_driver NCR_Q720_driver = {
 		.name		= "NCR_Q720",
 		.bus		= &mca_bus_type,
 		.probe		= NCR_Q720_probe,
-		.remove		= __devexit_p(NCR_Q720_remove),
+		.remove		= __exit_p(NCR_Q720_remove),
 	},
 };
 
Signature · 6 lines
1.6.4.3

--
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
#32 lore raw

PATCH 19/34 move s3c_adc_remove to .devexit.text

In reply to Uwe Kleine-König

The function s3c_adc_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 arch/arm/plat-s3c24xx/adc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-s3c24xx/adc.c +1 -1
index 11117a7..4606072 100644
@@ -364,7 +364,7 @@ static int s3c_adc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int s3c_adc_remove(struct platform_device *pdev)
+static int __devexit s3c_adc_remove(struct platform_device *pdev)
 {
 	struct adc_device *adc = platform_get_drvdata(pdev);
 
Signature · 1 line
1.6.4.3
Acked-by on v1 19/34
#33 lore raw

Re: [PATCH 19/34] move s3c_adc_remove to .devexit.text

Quoted 7 lines · Uwe Kleine-König

The function s3c_adc_remove is used only wrapped by __devexit_p so define it using __devexit.

Quoted 3 lines
Cc Ramax Lo <[email protected]>
Cc Nelson Castillo <[email protected]>
Signature · 3 lines
Ben Dooks, Software Engineer, Simtec Electronics

http://www.simtec.co.uk/
#34 lore raw

PATCH 20/34 move s3c_pwm_remove to .devexit.text

In reply to Uwe Kleine-König

The function s3c_pwm_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 arch/arm/plat-s3c/pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-s3c/pwm.c +1 -1
index 4fdc5b3..ef019f2 100644
@@ -368,7 +368,7 @@ static int s3c_pwm_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int s3c_pwm_remove(struct platform_device *pdev)
+static int __devexit s3c_pwm_remove(struct platform_device *pdev)
 {
 	struct pwm_device *pwm = platform_get_drvdata(pdev);
 
Signature · 1 line
1.6.4.3
#35 lore raw

PATCH 21/34 wrap sc26xx_driver_remove by __exit_p

In reply to Uwe Kleine-König

sc26xx_driver_remove is defined using __exit, so wrap it's usage by __exit_p. This fixes compiling as builtin.

---
 drivers/serial/sc26xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/sc26xx.c +1 -1
index 75038ad..8ff13eb 100644
@@ -729,7 +729,7 @@ static int __exit sc26xx_driver_remove(struct platform_device *dev)
 
 static struct platform_driver sc26xx_driver = {
 	.probe	= sc26xx_probe,
-	.remove	= __devexit_p(sc26xx_driver_remove),
+	.remove	= __exit_p(sc26xx_driver_remove),
 	.driver	= {
 		.name	= "SC26xx",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3
#36 lore raw

PATCH 22/34 don't use __devexit_p to wrap sgiseeq_remove

In reply to Uwe Kleine-König

The function sgiseeq_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

---
 drivers/net/sgiseeq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sgiseeq.c +1 -1
index ecf3279..f4dfd1f 100644
@@ -826,7 +826,7 @@ static int __exit sgiseeq_remove(struct platform_device *pdev)
 
 static struct platform_driver sgiseeq_driver = {
 	.probe	= sgiseeq_probe,
-	.remove	= __devexit_p(sgiseeq_remove),
+	.remove	= __exit_p(sgiseeq_remove),
 	.driver = {
 		.name	= "sgiseeq",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3
#37 lore raw

PATCH 23/34 don't use __devexit_p to wrap sgiwd93_remove

In reply to Uwe Kleine-König

The function sgiwd93_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc James E.J. Bottomley <[email protected]>
Cc James Bottomley <[email protected]>
Cc Dmitri Vorobiev <[email protected]>
---
 drivers/scsi/sgiwd93.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/sgiwd93.c +1 -1
index 0807b26..2f28ec4 100644
@@ -312,7 +312,7 @@ static int __exit sgiwd93_remove(struct platform_device *pdev)
 
 static struct platform_driver sgiwd93_driver = {
 	.probe  = sgiwd93_probe,
-	.remove = __devexit_p(sgiwd93_remove),
+	.remove = __exit_p(sgiwd93_remove),
 	.driver = {
 		.name   = "sgiwd93",
 		.owner	= THIS_MODULE,
Signature · 6 lines
1.6.4.3

--
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
#38 lore raw

PATCH 24/34 don't use __devexit_p to wrap snd_sgio2audio_remove

In reply to Uwe Kleine-König

The function snd_sgio2audio_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

---
 sound/mips/sgio2audio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/mips/sgio2audio.c +1 -1
index e497525..e24ba5a 100644
@@ -984,7 +984,7 @@ static int __exit snd_sgio2audio_remove(struct platform_device *pdev)
 
 static struct platform_driver sgio2audio_driver = {
 	.probe	= snd_sgio2audio_probe,
-	.remove	= __devexit_p(snd_sgio2audio_remove),
+	.remove	= __exit_p(snd_sgio2audio_remove),
 	.driver = {
 		.name	= "sgio2audio",
 		.owner	= THIS_MODULE,
Signature · 1 line
1.6.4.3
#39 lore raw

PATCH 25/34 don't use __devexit_p to wrap snirm710_driver_remove

In reply to Uwe Kleine-König

The function snirm710_driver_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc James E.J. Bottomley <[email protected]>
Cc Yang Hongyang <[email protected]>
Cc Kay Sievers <[email protected]>
Cc James Bottomley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/scsi/sni_53c710.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/sni_53c710.c +1 -1
index 37b3359..491a088 100644
@@ -133,7 +133,7 @@ static int __exit snirm710_driver_remove(struct platform_device *dev)
 
 static struct platform_driver snirm710_driver = {
 	.probe	= snirm710_probe,
-	.remove	= __devexit_p(snirm710_driver_remove),
+	.remove	= __exit_p(snirm710_driver_remove),
 	.driver	= {
 		.name	= "snirm_53c710",
 		.owner	= THIS_MODULE,
Signature · 6 lines
1.6.4.3

--
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
#40 lore raw

PATCH 26/34 move spidev_remove to .devexit.text

In reply to Uwe Kleine-König

The function spidev_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/spi/spidev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/spidev.c +1 -1
index f921bd1..3379ab9 100644
@@ -610,7 +610,7 @@ static int spidev_probe(struct spi_device *spi)
 	return status;
 }
 
-static int spidev_remove(struct spi_device *spi)
+static int __devexit spidev_remove(struct spi_device *spi)
 {
 	struct spidev_data	*spidev = spi_get_drvdata(spi);
 
Signature · 13 lines
1.6.4.3


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general
#41 lore raw

PATCH 27/34 move stex_remove to .devexit.text

In reply to Uwe Kleine-König

The function stex_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Willem Riede <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Cc "Kai Mäkisara" <[email protected]>
Cc James Bottomley <[email protected]>
Cc Ed Lin <[email protected]>
Cc Yang Hongyang <[email protected]>
Cc Andrew Morton <[email protected]>
---
 drivers/scsi/stex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/stex.c +1 -1
index 09fa886..09ee386 100644
@@ -1679,7 +1679,7 @@ static void stex_hba_free(struct st_hba *hba)
 			  hba->dma_mem, hba->dma_handle);
 }
 
-static void stex_remove(struct pci_dev *pdev)
+static void __devexit stex_remove(struct pci_dev *pdev)
 {
 	struct st_hba *hba = pci_get_drvdata(pdev);
 
Signature · 1 line
1.6.4.3
#42 lore raw

PATCH 28/34 move vhci_hcd_remove to .devexit.text

In reply to Uwe Kleine-König

The function vhci_hcd_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/staging/usbip/vhci_hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/usbip/vhci_hcd.c +1 -1
index 6e91fc2..22b1c6c 100644
@@ -1131,7 +1131,7 @@ static int vhci_hcd_probe(struct platform_device *pdev)
 }
 
 
-static int vhci_hcd_remove(struct platform_device *pdev)
+static int __devexit vhci_hcd_remove(struct platform_device *pdev)
 {
 	struct usb_hcd	*hcd;
 
Signature · 1 line
1.6.4.3
#43 lore raw

PATCH 29/34 move virtballoon_remove to .devexit.text

In reply to Uwe Kleine-König

The function virtballoon_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/virtio/virtio_balloon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/virtio/virtio_balloon.c +1 -1
index 200c22f..b2d28bb 100644
@@ -248,7 +248,7 @@ out:
 	return err;
 }
 
-static void virtballoon_remove(struct virtio_device *vdev)
+static void __devexit virtballoon_remove(struct virtio_device *vdev)
 {
 	struct virtio_balloon *vb = vdev->priv;
 
Signature · 1 line
1.6.4.3
maintainer Acked-by on v1 29/34
#44 lore raw

Re: [PATCH 29/34] move virtballoon_remove to .devexit.text

Quoted 8 lines · Uwe Kleine-König

The function virtballoon_remove is used only wrapped by __devexit_p so define it using __devexit.

Generally I think all remove pointers on virtio bus are devexit. How do you find all these, and remember to mark new ones properly? Can we annotate the remove pointer in struct virtio_driver so that sparse can find them?

Quoted 19 lines
---
 drivers/virtio/virtio_balloon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/virtio/virtio_balloon.c +1 -1
index 200c22f..b2d28bb 100644
@@ -248,7 +248,7 @@ out:
 	return err;
 }
 
-static void virtballoon_remove(struct virtio_device *vdev)
+static void __devexit virtballoon_remove(struct virtio_device *vdev)
 {
 	struct virtio_balloon *vb = vdev->priv;
 
Signature · 1 line
1.6.4.3
#45 lore raw

Re: [PATCH 29/34] move virtballoon_remove to .devexit.text

Hello Michael,

Quoted 10 lines · Michael S. Tsirkin
Quoted 8 lines · Uwe Kleine-König

The function virtballoon_remove is used only wrapped by __devexit_p so define it using __devexit.

Quoted 3 lines

Generally I think all remove pointers on virtio bus are devexit.

That means I missed something?

Quoted 2 lines

How do
you find all these,

I have a script that only generates few false-positives (and an unknown number of false-negatives).

Quoted 1 line

and remember to mark new ones properly?

I don't understand that question. You need to have understood how these markings work and do it right.

Quoted 3 lines

Can we
annotate the remove pointer in struct virtio_driver so that sparse can find them?

I already thought about a runtime check. I didn't implement anything yet though.

I can give you my script that finds problems for platform_drivers. You should be able to adapt it for other types of drivers easily. When most platform_driver patches are in, I plan to look at pci.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#46 lore raw

Re: [PATCH 29/34] move virtballoon_remove to .devexit.text

Quoted 13 lines · Uwe Kleine-König

Hello Michael,

Quoted 10 lines · Michael S. Tsirkin
Quoted 8 lines · Uwe Kleine-König

The function virtballoon_remove is used only wrapped by __devexit_p so define it using __devexit.

Quoted 4 lines
Quoted 3 lines

Generally I think all remove pointers on virtio bus are devexit.

That means I missed something?

I meant to say, they *should* be devexit.

#47 lore raw

Re: [PATCH 29/34] move virtballoon_remove to .devexit.text

In reply to Uwe Kleine-König
Quoted 2 lines · Uwe Kleine-König

The function virtballoon_remove is used only wrapped by __devexit_p so define it using __devexit.

Thanks, applied!

Rusty.

#48 lore raw

PATCH 30/34 move virtnet_remove to .devexit.text

In reply to Uwe Kleine-König

The function virtnet_remove is used only wrapped by __devexit_p so define it using __devexit.

---
 drivers/net/virtio_net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/virtio_net.c +1 -1
index d445845..8d00976 100644
@@ -948,7 +948,7 @@ free:
 	return err;
 }
 
-static void virtnet_remove(struct virtio_device *vdev)
+static void __devexit virtnet_remove(struct virtio_device *vdev)
 {
 	struct virtnet_info *vi = vdev->priv;
 	struct sk_buff *skb;
Signature · 1 line
1.6.4.3
#49 lore raw

PATCH 31/34 move virtrng_remove to .devexit.text

In reply to Uwe Kleine-König

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>
---
 drivers/char/hw_random/virtio-rng.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/hw_random/virtio-rng.c +1 -1
index 962968f..74189b5 100644
@@ -117,7 +117,7 @@ static int virtrng_probe(struct virtio_device *vdev)
 	return 0;
 }
 
-static void virtrng_remove(struct virtio_device *vdev)
+static void __devexit virtrng_remove(struct virtio_device *vdev)
 {
 	vdev->config->reset(vdev);
 	hwrng_unregister(&virtio_hwrng);
Signature · 1 line
1.6.4.3
Acked-by on v1 31/34
#50 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

[...]

Quoted 2 lines
drivers/char/hw_random/virtio-rng.c +1 -1
-static void virtrng_remove(struct virtio_device *vdev)
+static void __devexit virtrng_remove(struct virtio_device *vdev)

[...]

#51 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Quoted 11 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>

Thanks

Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

I think I once had a patch for that, but while updating the series it was dropped. I'll recheck for the next iteration.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
maintainer Acked-by
#52 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

In reply to Christian Borntraeger
Quoted 11 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>

FWIW

Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

Yes, and more importantly drivers/virtio/virtio.c as well.

Quoted 5 lines

[...]

Quoted 2 lines
drivers/char/hw_random/virtio-rng.c +1 -1
-static void virtrng_remove(struct virtio_device *vdev)
+static void __devexit virtrng_remove(struct virtio_device *vdev)

[...]

#53 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Hello,

Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>
Quoted 4 lines
Quoted 1 line

FWIW

ok

Quoted 2 lines
Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

http://thread.gmane.org/gmane.linux.kernel/896297/focus=896309

Quoted 1 line

Yes, and more importantly drivers/virtio/virtio.c as well.

Hm, I don't see it:

	$ git grep -E '__(dev)?exit_p' linus/master:drivers/virtio/virtio.c
	$

Well, you could add something, but adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG.

In this series I only addressed drivers that use __{,dev}exit and __{,dev}exit_p inconsistenly. I.e. my script greps for __{,dev}exit_p and checks the prototype of the wrapped function. I have another script that does a similar check for platform_devices in general. This one also notices if you have a __devexit function that isn't wrapped by __devexit_p.

So if you want to see drivers/virtio/virtio.c improving, send patches yourself :-)

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#54 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Quoted 25 lines · Uwe Kleine-König

Hello,

Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>
Quoted 4 lines
Quoted 1 line

FWIW

ok

Quoted 2 lines
Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

http://thread.gmane.org/gmane.linux.kernel/896297/focus=896309

Quoted 1 line

Yes, and more importantly drivers/virtio/virtio.c as well.

Quoted 8 lines

Hm, I don't see it:

	$ git grep -E '__(dev)?exit_p' linus/master:drivers/virtio/virtio.c
	$

Well, you could add something, but adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG.

And MODULE.

Quoted 6 lines

In this series I only addressed drivers that use __{,dev}exit and __{,dev}exit_p inconsistenly. I.e. my script greps for __{,dev}exit_p and checks the prototype of the wrapped function. I have another script that does a similar check for platform_devices in general. This one also notices if you have a __devexit function that isn't wrapped by __devexit_p.

Can we teach sparse about this?

Quoted 2 lines

So if you want to see drivers/virtio/virtio.c improving, send patches yourself :-)

Here's my reasoning:
include/linux/virtio.h defines virtio_driver, and remove pointer there is only used on hot-unplug or module removal.
This is the only reason I see that we can make device removal as devexit. So we can make all of them devexit then?

Quoted 6 lines

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#55 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Hello,

Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Uwe Kleine-König

Hello,

Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>
Quoted 4 lines
Quoted 1 line

FWIW

ok

Quoted 2 lines
Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

http://thread.gmane.org/gmane.linux.kernel/896297/focus=896309

Quoted 1 line

Yes, and more importantly drivers/virtio/virtio.c as well.

Hm, I don't see it:

Quoted 8 lines
Quoted 6 lines
	$ git grep -E '__(dev)?exit_p' linus/master:drivers/virtio/virtio.c
	$

Well, you could add something, but adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG.

And MODULE.

Well, discarding does not really depend on CONFIG_MODULE. .devexit sections are only discarded from vmlinux (and not modules) and only if CONFIG_HOTPLUG=n. So my statement could be extended to:

Adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG and then only for code that is not compiled as a module.

Quoted 8 lines
Quoted 6 lines

In this series I only addressed drivers that use __{,dev}exit and __{,dev}exit_p inconsistenly. I.e. my script greps for __{,dev}exit_p and checks the prototype of the wrapped function. I have another script that does a similar check for platform_devices in general. This one also notices if you have a __devexit function that isn't wrapped by __devexit_p.

Can we teach sparse about this?

I don't know much about sparse, better ask on linux-sparse.

Quoted 8 lines
Quoted 2 lines

So if you want to see drivers/virtio/virtio.c improving, send patches yourself :-)

Here's my reasoning:
include/linux/virtio.h defines virtio_driver, and remove pointer there is only used on hot-unplug or module removal.
This is the only reason I see that we can make device removal as devexit. So we can make all of them devexit then?

Exactly the same applies to platform_drivers. The remove callback is only called if the driver is unregistered or the device is unbound.

But note it's not an error in general to use a .text function as remove callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove is used in gpio_twl4030_probe which is defined using __devinit. So using __devexit for gpio_twl4030_remove is wrong. (So there is a bug, as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I understand this will result in a compile error if the driver is built-in with HOTPLUG=n.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#56 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Quoted 68 lines · Uwe Kleine-König

Hello,

Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Uwe Kleine-König

Hello,

Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Christian Borntraeger

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:

Quoted 8 lines

The function virtrng_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Rusty Russell <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Christian Borntraeger <[email protected]>
Quoted 4 lines
Quoted 1 line

FWIW

ok

Quoted 2 lines
Quoted 2 lines

It seems that there are similar changes possible in other virtio drivers (e.g. virtio_net).

http://thread.gmane.org/gmane.linux.kernel/896297/focus=896309

Quoted 1 line

Yes, and more importantly drivers/virtio/virtio.c as well.

Hm, I don't see it:

Quoted 8 lines
Quoted 6 lines
	$ git grep -E '__(dev)?exit_p' linus/master:drivers/virtio/virtio.c
	$

Well, you could add something, but adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG.

And MODULE.

Well, discarding does not really depend on CONFIG_MODULE. .devexit sections are only discarded from vmlinux (and not modules) and only if CONFIG_HOTPLUG=n. So my statement could be extended to:

Adding __devexit is a noop for most kernels. It matters only if you don't have CONFIG_HOTPLUG and then only for code that is not compiled as a module.

Quoted 8 lines
Quoted 6 lines

In this series I only addressed drivers that use __{,dev}exit and __{,dev}exit_p inconsistenly. I.e. my script greps for __{,dev}exit_p and checks the prototype of the wrapped function. I have another script that does a similar check for platform_devices in general. This one also notices if you have a __devexit function that isn't wrapped by __devexit_p.

Can we teach sparse about this?

I don't know much about sparse, better ask on linux-sparse.

Quoted 8 lines
Quoted 2 lines

So if you want to see drivers/virtio/virtio.c improving, send patches yourself :-)

Here's my reasoning:
include/linux/virtio.h defines virtio_driver, and remove pointer there is only used on hot-unplug or module removal.
This is the only reason I see that we can make device removal as devexit. So we can make all of them devexit then?

Exactly the same applies to platform_drivers. The remove callback is only called if the driver is unregistered or the device is unbound.

Quoted 7 lines

But note it's not an error in general to use a .text function as remove callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove is used in gpio_twl4030_probe which is defined using __devinit. So using __devexit for gpio_twl4030_remove is wrong. (So there is a bug, as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I understand this will result in a compile error if the driver is built-in with HOTPLUG=n.

Wait a second.
As far as I understand, __devexit makes it possible to remove code if hotplug is off.

At least for static functions, it's enough to mark their only use as _devexit_p, and compiler will remove the text as it's unused.

Isn't that right?

If so, what, again, was the motivation for the patches that added __devexit to functions that were already used with __devexit_p?

Quoted 6 lines

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#57 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Hello Michael,

Quoted 11 lines
Quoted 7 lines

But note it's not an error in general to use a .text function as remove callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove is used in gpio_twl4030_probe which is defined using __devinit. So using __devexit for gpio_twl4030_remove is wrong. (So there is a bug, as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I understand this will result in a compile error if the driver is built-in with HOTPLUG=n.

Wait a second.
As far as I understand, __devexit makes it possible to remove code if hotplug is off.

right.

Quoted 4 lines

At least for static functions, it's enough to mark their only use as _devexit_p, and compiler will remove the text as it's unused.

Isn't that right?

hmm, I don't know. I'll try, one moment. OK, you're right. The function is discarded with a compiler warning.

Quoted 2 lines

If so, what, again, was the motivation for the patches that added __devexit to functions that were already used with __devexit_p?

I thought it saves some memory, but as it looks now it only fixes a compiler warning.

Note there are two types of errors fixed in this series. One is:

-static int func(void arg)
+static int __devexit func(void arg)

if the only usage of func() is wraped by __devexit_p. This is (as seen above) not that critical, there is only a warning fixed.

The other type results in a build failure:

	-remove = __devexit_p(another_func),
	+remove = __exit_p(another_func),

with another_func being defined using __exit. In the case defined(MODULE) && defined(CONFIG_HOTPLUG) another_func is discarded, but __devexit_p(another_func) evaluates to another_func and thus the module doesn't link.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#58 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Quoted 18 lines · Uwe Kleine-König

Hello Michael,

Quoted 11 lines
Quoted 7 lines

But note it's not an error in general to use a .text function as remove callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove is used in gpio_twl4030_probe which is defined using __devinit. So using __devexit for gpio_twl4030_remove is wrong. (So there is a bug, as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I understand this will result in a compile error if the driver is built-in with HOTPLUG=n.

Wait a second.
As far as I understand, __devexit makes it possible to remove code if hotplug is off.

right.

Quoted 3 lines

At least for static functions, it's enough to mark their only use as _devexit_p, and compiler will remove the text as it's unused.

Quoted 8 lines
Quoted 1 line

Isn't that right?

hmm, I don't know. I'll try, one moment. OK, you're right. The function is discarded with a compiler warning.

Quoted 2 lines

If so, what, again, was the motivation for the patches that added __devexit to functions that were already used with __devexit_p?

I thought it saves some memory, but as it looks now it only fixes a compiler warning.

We can redefine __devexit_p(x) to something like #define __devexit_p(x) ((typeof(x) *)NULL)
and this will shut down the warning without need to fix the code.

Using _devexit_p for static functions is also safer than __devexit since if you define a function as __devexit and by mistake call it from another context, it won't link.

Makes sense?

Quoted 10 lines

Note there are two types of errors fixed in this series. One is:

-static int func(void arg)
+static int __devexit func(void arg)

if the only usage of func() is wraped by __devexit_p. This is (as seen above) not that critical, there is only a warning fixed.

The other type results in a build failure:

Quoted 7 lines
	-remove = __devexit_p(another_func),
	+remove = __exit_p(another_func),

with another_func being defined using __exit. In the case defined(MODULE) && defined(CONFIG_HOTPLUG) another_func is discarded, but __devexit_p(another_func) evaluates to another_func and thus the module doesn't link.

Yes, calling __exit function from non- __exit is always a bug. I think there's a make flag to warn about this, not sure why it's not the default.

Quoted 6 lines

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#59 lore raw

Re: [PATCH 31/34] move virtrng_remove to .devexit.text

Hello Michael,

Quoted 23 lines · Michael S. Tsirkin
Quoted 22 lines · Uwe Kleine-König

Hello Michael,

Quoted 11 lines
Quoted 7 lines

But note it's not an error in general to use a .text function as remove callback. E.g. take drivers/gpio/twl4030-gpio.c. gpio_twl4030_remove is used in gpio_twl4030_probe which is defined using __devinit. So using __devexit for gpio_twl4030_remove is wrong. (So there is a bug, as gpio_twl4030_remove uses __devexit.) I didn't try, but as far as I understand this will result in a compile error if the driver is built-in with HOTPLUG=n.

Wait a second.
As far as I understand, __devexit makes it possible to remove code if hotplug is off.

right.

Quoted 4 lines

At least for static functions, it's enough to mark their only use as _devexit_p, and compiler will remove the text as it's unused.

Isn't that right?

hmm, I don't know. I'll try, one moment. OK, you're right. The function is discarded with a compiler warning.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If so, what, again, was the motivation for the patches that added __devexit to functions that were already used with __devexit_p?

I thought it saves some memory, but as it looks now it only fixes a compiler warning.

We can redefine __devexit_p(x) to something like #define __devexit_p(x) ((typeof(x) *)NULL)
and this will shut down the warning without need to fix the code.

Mmmmh, don't know. A definitive advantage is that there is only a single point in the code that defines if a function is discarded or not. Nothing that needs to be consistent.
For me it feels somehow wrong anyhow, but that might be only because I'm used to the current model.

Quoted 13 lines
Quoted 13 lines

Note there are two types of errors fixed in this series. One is:

-static int func(void arg)
+static int __devexit func(void arg)

if the only usage of func() is wraped by __devexit_p. This is (as seen above) not that critical, there is only a warning fixed.

The other type results in a build failure:

	-remove = __devexit_p(another_func),
	+remove = __exit_p(another_func),
Quoted 8 lines
Quoted 4 lines

with another_func being defined using __exit. In the case defined(MODULE) && defined(CONFIG_HOTPLUG) another_func is discarded, but __devexit_p(another_func) evaluates to another_func and thus the module doesn't link.

Yes, calling __exit function from non- __exit is always a bug. I think there's a make flag to warn about this, not sure why it's not the default.

I think it was disabled because there were too many warnings :-)

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
#60 lore raw

PATCH 32/34 don't use __devexit_p to wrap zalon_remove

In reply to Uwe Kleine-König

The function zalon_remove is defined using __exit, so don't use __devexit_p but __exit_p to wrap it.

Cc James E.J. Bottomley <[email protected]>
Cc James Bottomley <[email protected]>
Cc Kyle McMartin <[email protected]>
Cc Kay Sievers <[email protected]>
Cc Helge Deller <[email protected]>
---
 drivers/scsi/zalon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/zalon.c +1 -1
index 27e84e4..19120a6 100644
@@ -182,7 +182,7 @@ static struct parisc_driver zalon_driver = {
 	.name =		"zalon",
 	.id_table =	zalon_tbl,
 	.probe =	zalon_probe,
-	.remove =	__devexit_p(zalon_remove),
+	.remove =	__exit_p(zalon_remove),
 };
 
 static int __init zalon7xx_init(void)
Signature · 6 lines
1.6.4.3

--
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
#61 lore raw

PATCH 33/34 move lis3l02dq_remove to .devexit.text

In reply to Uwe Kleine-König

The function lis3l02dq_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Jonathan Cameron <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/iio/accel/lis3l02dq_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/lis3l02dq_core.c +1 -1
index f008837..80e89a6 100644
@@ -871,7 +871,7 @@ err_ret:
 }
 
 /* fixme, confirm ordering in this function */
-static int lis3l02dq_remove(struct spi_device *spi)
+static int __devexit lis3l02dq_remove(struct spi_device *spi)
 {
 	int ret;
 	struct lis3l02dq_state *st = spi_get_drvdata(spi);
Signature · 1 line
1.6.4.3
Acked-by on v1 33/34
#62 lore raw

Re: [PATCH 33/34] move lis3l02dq_remove to .devexit.text

Thanks Uwe

Quoted 24 lines

The function lis3l02dq_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Jonathan Cameron <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/iio/accel/lis3l02dq_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/lis3l02dq_core.c +1 -1
index f008837..80e89a6 100644
@@ -871,7 +871,7 @@ err_ret:
 }
 
 /* fixme, confirm ordering in this function */
-static int lis3l02dq_remove(struct spi_device *spi)
+static int __devexit lis3l02dq_remove(struct spi_device *spi)
 {
 	int ret;
 	struct lis3l02dq_state *st = spi_get_drvdata(spi);
#63 lore raw

PATCH 34/34 move sca3000_remove to .devexit.text

In reply to Uwe Kleine-König

The function sca3000_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Jonathan Cameron <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/iio/accel/sca3000_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/sca3000_core.c +1 -1
index e27e3b7..5ea736a 100644
@@ -1393,7 +1393,7 @@ error_ret:
 
 }
 
-static int sca3000_remove(struct spi_device *spi)
+static int __devexit sca3000_remove(struct spi_device *spi)
 {
 	struct sca3000_state *st =  spi_get_drvdata(spi);
 	struct iio_dev *indio_dev = st->indio_dev;
Signature · 1 line
1.6.4.3
Acked-by on v1 34/34
#64 lore raw

Re: [PATCH 34/34] move sca3000_remove to .devexit.text

Hi Uwe,

Thanks,

Quoted 24 lines

The function sca3000_remove is used only wrapped by __devexit_p so define it using __devexit.

Cc Jonathan Cameron <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/iio/accel/sca3000_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/iio/accel/sca3000_core.c +1 -1
index e27e3b7..5ea736a 100644
@@ -1393,7 +1393,7 @@ error_ret:
 
 }
 
-static int sca3000_remove(struct spi_device *spi)
+static int __devexit sca3000_remove(struct spi_device *spi)
 {
 	struct sca3000_state *st =  spi_get_drvdata(spi);
 	struct iio_dev *indio_dev = st->indio_dev;