2009-10-01 08:26:13

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 00/35] 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |


2009-10-01 08:28:46

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 01/34] move asic3_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
---
drivers/mfd/asic3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 63a2a66..e22128c 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -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);
--
1.6.4.3

2009-10-01 08:33:01

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 02/34] move atp870u_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/atp870u.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index b137e56..1059167 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -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;
--
1.6.4.3

2009-10-01 08:29:14

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 03/34] move bbc_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/input/misc/sparcspkr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index c4f4231..5399dd2 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -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;
--
1.6.4.3

2009-10-01 08:29:09

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 04/34] don't use __devexit_p to wrap excite_nand_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Ming Lei <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: David Brownell <[email protected]>
Cc: [email protected]
---
drivers/mtd/nand/excite_nandflash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/excite_nandflash.c b/drivers/mtd/nand/excite_nandflash.c
index 72446fb..630b4d6 100644
--- a/drivers/mtd/nand/excite_nandflash.c
+++ b/drivers/mtd/nand/excite_nandflash.c
@@ -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)
--
1.6.4.3

2009-10-01 08:28:58

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 05/34] move grover_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/input/misc/sparcspkr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 5399dd2..b064419 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -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;
--
1.6.4.3

2009-10-01 08:32:05

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 06/34] don't use __devexit_p to wrap hal2_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
sound/mips/hal2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c
index c52691c..72523a7 100644
--- a/sound/mips/hal2.c
+++ b/sound/mips/hal2.c
@@ -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,
--
1.6.4.3

2009-10-01 08:35:49

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 07/34] move ilo_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: David Altobelli <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
---
drivers/misc/hpilo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
index 1ad27c6..9ec007e 100644
--- a/drivers/misc/hpilo.c
+++ b/drivers/misc/hpilo.c
@@ -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);
--
1.6.4.3

2009-10-01 08:29:56

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 08/34] move initio_remove_one to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/initio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 89a5948..8bbfd99 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -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;
--
1.6.4.3

2009-10-01 08:36:34

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 09/34] don't use __devexit_p to wrap iodev_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Ming Lei <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: David Brownell <[email protected]>
Cc: [email protected]
---
arch/mips/basler/excite/excite_iodev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c
index 938b1d0..5351b91 100644
--- a/arch/mips/basler/excite/excite_iodev.c
+++ b/arch/mips/basler/excite/excite_iodev.c
@@ -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),
};


--
1.6.4.3

2009-10-01 08:29:52

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 10/34] don't use __devexit_p to wrap lasi700_driver_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/lasi700.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index b3d3131..2991c81 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -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
--
1.6.4.3

2009-10-01 08:29:13

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 11/34] move mcf_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Len Sorensen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: [email protected]
---
drivers/serial/mcf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c
index b443824..7bb5fee 100644
--- a/drivers/serial/mcf.c
+++ b/drivers/serial/mcf.c
@@ -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;
--
1.6.4.3

2009-10-01 08:34:57

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 12/34] move megaraid_detach_one to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Neela Syam Kolli <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: Yang Hongyang <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/megaraid/megaraid_mbox.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 234f0b7..9fc9cf7 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -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;
--
1.6.4.3

2009-10-01 08:30:37

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 13/34] don't use __devexit_p to wrap meth_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/net/meth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 92ceb68..2af8173 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -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,
--
1.6.4.3

2009-10-01 08:34:23

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 14/34] don't wrap mlx4_remove_one in __devexit_p

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

Signed-off-by: Uwe Kleine-König <[email protected]>
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]>
Cc: [email protected]
---
drivers/net/mlx4/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 3dd481e..00625a7 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -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)
--
1.6.4.3

2009-10-01 08:29:23

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 15/34] move mpc85xx_pci_err_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Doug Thompson <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Kumar Gala <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: [email protected]
---
drivers/edac/mpc85xx_edac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 157f650..ce6d759 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -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;
--
1.6.4.3

2009-10-01 08:34:59

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 16/34] move mv64x60_pci_err_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
---
drivers/edac/mv64x60_edac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/edac/mv64x60_edac.c b/drivers/edac/mv64x60_edac.c
index a6b9fec..ed25d73 100644
--- a/drivers/edac/mv64x60_edac.c
+++ b/drivers/edac/mv64x60_edac.c
@@ -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);

--
1.6.4.3

2009-10-01 08:31:29

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 17/34] move mxcnd_remove to .exit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/mtd/nand/mxc_nand.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 65b26d5..ef3e199 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -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);

--
1.6.4.3

2009-10-01 08:34:05

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 18/34] don't use __devexit_p to wrap NCR_Q720_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/NCR_Q720.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/NCR_Q720.c b/drivers/scsi/NCR_Q720.c
index a8bbdc2..572042f 100644
--- a/drivers/scsi/NCR_Q720.c
+++ b/drivers/scsi/NCR_Q720.c
@@ -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),
},
};

--
1.6.4.3

2009-10-01 08:29:38

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 19/34] move s3c_adc_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Ramax Lo <[email protected]>
Cc: Nelson Castillo <[email protected]>
Cc: [email protected]
---
arch/arm/plat-s3c24xx/adc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index 11117a7..4606072 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -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);

--
1.6.4.3

2009-10-01 08:34:26

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 20/34] move s3c_pwm_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Peter Korsgaard <[email protected]>
Cc: [email protected]
---
arch/arm/plat-s3c/pwm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-s3c/pwm.c b/arch/arm/plat-s3c/pwm.c
index 4fdc5b3..ef019f2 100644
--- a/arch/arm/plat-s3c/pwm.c
+++ b/arch/arm/plat-s3c/pwm.c
@@ -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);

--
1.6.4.3

2009-10-01 08:32:33

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 21/34] wrap sc26xx_driver_remove by __exit_p

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: [email protected]
---
drivers/serial/sc26xx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/sc26xx.c b/drivers/serial/sc26xx.c
index 75038ad..8ff13eb 100644
--- a/drivers/serial/sc26xx.c
+++ b/drivers/serial/sc26xx.c
@@ -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,
--
1.6.4.3

2009-10-01 08:29:39

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 22/34] don't use __devexit_p to wrap sgiseeq_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Wang Chen <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/net/sgiseeq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index ecf3279..f4dfd1f 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -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,
--
1.6.4.3

2009-10-01 08:32:07

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 23/34] don't use __devexit_p to wrap sgiwd93_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Dmitri Vorobiev <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/sgiwd93.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 0807b26..2f28ec4 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -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,
--
1.6.4.3

2009-10-01 08:29:53

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 24/34] don't use __devexit_p to wrap snd_sgio2audio_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Figo.zhang <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
sound/mips/sgio2audio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index e497525..e24ba5a 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -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,
--
1.6.4.3

2009-10-01 08:31:51

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 25/34] don't use __devexit_p to wrap snirm710_driver_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/sni_53c710.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 37b3359..491a088 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -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,
--
1.6.4.3

2009-10-01 08:29:24

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 26/34] move spidev_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Wolfgang Ocker <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/spi/spidev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index f921bd1..3379ab9 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -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);

--
1.6.4.3

2009-10-01 08:29:34

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 27/34] move stex_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/stex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 09fa886..09ee386 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -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);

--
1.6.4.3

2009-10-01 08:33:23

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 28/34] move vhci_hcd_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Brian G. Merrell <[email protected]>
Cc: Shan Wei <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/staging/usbip/vhci_hcd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 6e91fc2..22b1c6c 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -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;

--
1.6.4.3

2009-10-01 08:36:06

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 29/34] move virtballoon_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
---
drivers/virtio/virtio_balloon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 200c22f..b2d28bb 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -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;

--
1.6.4.3

2009-10-01 08:30:05

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 30/34] move virtnet_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Alex Williamson <[email protected]>
Cc: Mark McLoughlin <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/net/virtio_net.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d445845..8d00976 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -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;
--
1.6.4.3

2009-10-01 08:29:26

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 31/34] move virtrng_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: [email protected]
---
drivers/char/hw_random/virtio-rng.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 962968f..74189b5 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -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);
--
1.6.4.3

2009-10-01 08:33:49

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 32/34] don't use __devexit_p to wrap zalon_remove

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

Signed-off-by: Uwe Kleine-König <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/zalon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 27e84e4..19120a6 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -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)
--
1.6.4.3

2009-10-01 08:34:41

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 33/34] move lis3l02dq_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
---
drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index f008837..80e89a6 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -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);
--
1.6.4.3

2009-10-01 08:33:25

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 34/34] move sca3000_remove to .devexit.text

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

Signed-off-by: Uwe Kleine-König <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
---
drivers/staging/iio/accel/sca3000_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index e27e3b7..5ea736a 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -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;
--
1.6.4.3

2009-10-01 08:37:04

by Takashi Iwai

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

At Thu, 1 Oct 2009 10:28:10 +0200,
Uwe Kleine-König wrote:
>
> 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

>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Cc: Takashi Iwai <[email protected]>
> Cc: Jaroslav Kysela <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> sound/mips/hal2.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c
> index c52691c..72523a7 100644
> --- a/sound/mips/hal2.c
> +++ b/sound/mips/hal2.c
> @@ -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,
> --
> 1.6.4.3
>

2009-10-01 08:44:47

by Christian Borntraeger

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

Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-König:
> The function virtrng_remove is used only wrapped by __devexit_p so define
> it using __devexit.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>
> Cc: Rusty Russell <[email protected]>
> Cc: Michael S. Tsirkin <[email protected]>
> Cc: Christian Borntraeger <[email protected]>

Acked-by: Christian Borntraeger <[email protected]>

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


[...]
> -static void virtrng_remove(struct virtio_device *vdev)
> +static void __devexit virtrng_remove(struct virtio_device *vdev)
[...]

2009-10-01 08:48:44

by Uwe Kleine-König

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

On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > The function virtrng_remove is used only wrapped by __devexit_p so define
> > it using __devexit.
> >
> > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > Acked-by: Sam Ravnborg <[email protected]>
> > Cc: Rusty Russell <[email protected]>
> > Cc: Michael S. Tsirkin <[email protected]>
> > Cc: Christian Borntraeger <[email protected]>
>
> Acked-by: Christian Borntraeger <[email protected]>
Thanks

> 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 08:53:56

by Uwe Kleine-König

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

On Thu, Oct 01, 2009 at 10:36:59AM +0200, Takashi Iwai wrote:
> At Thu, 1 Oct 2009 10:28:10 +0200,
> Uwe Kleine-K?nig wrote:
> >
> > 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 09:15:15

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > The function virtrng_remove is used only wrapped by __devexit_p so define
> > it using __devexit.
> >
> > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > Acked-by: Sam Ravnborg <[email protected]>
> > Cc: Rusty Russell <[email protected]>
> > Cc: Michael S. Tsirkin <[email protected]>
> > Cc: Christian Borntraeger <[email protected]>
>
> Acked-by: Christian Borntraeger <[email protected]>

FWIW
Acked-by: Michael S. Tsirkin <[email protected]>

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

>
> [...]
> > -static void virtrng_remove(struct virtio_device *vdev)
> > +static void __devexit virtrng_remove(struct virtio_device *vdev)
> [...]

2009-10-01 09:31:06

by Uwe Kleine-König

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

Hello,

On Thu, Oct 01, 2009 at 11:12:18AM +0200, Michael S. Tsirkin wrote:
> On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> > Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > > The function virtrng_remove is used only wrapped by __devexit_p so define
> > > it using __devexit.
> > >
> > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > > Acked-by: Sam Ravnborg <[email protected]>
> > > Cc: Rusty Russell <[email protected]>
> > > Cc: Michael S. Tsirkin <[email protected]>
> > > Cc: Christian Borntraeger <[email protected]>
> >
> > Acked-by: Christian Borntraeger <[email protected]>
>
> FWIW
> Acked-by: Michael S. Tsirkin <[email protected]>
ok

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

> 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 09:38:09

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 10:28:33AM +0200, Uwe Kleine-K?nig wrote:
> The function virtballoon_remove is used only wrapped by __devexit_p so
> define it using __devexit.
>
> Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>
> Cc: Rusty Russell <[email protected]>
> Cc: Michael S. Tsirkin <[email protected]>
> Cc: [email protected]

Acked-by: Michael S. Tsirkin <[email protected]>

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?

> ---
> drivers/virtio/virtio_balloon.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 200c22f..b2d28bb 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -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;
>
> --
> 1.6.4.3

2009-10-01 09:38:32

by Jonathan Cameron

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

Thanks Uwe

Acked-by: Jonathan Cameron <[email protected]>
> The function lis3l02dq_remove is used only wrapped by __devexit_p so
> define it using __devexit.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Cc: Jonathan Cameron <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> ---
> drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
> index f008837..80e89a6 100644
> --- a/drivers/staging/iio/accel/lis3l02dq_core.c
> +++ b/drivers/staging/iio/accel/lis3l02dq_core.c
> @@ -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);

2009-10-01 09:39:16

by Jonathan Cameron

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

Hi Uwe,

Thanks,

Acked-by: Jonathan Cameron <[email protected]>
> The function sca3000_remove is used only wrapped by __devexit_p so define
> it using __devexit.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Cc: Jonathan Cameron <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> ---
> drivers/staging/iio/accel/sca3000_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
> index e27e3b7..5ea736a 100644
> --- a/drivers/staging/iio/accel/sca3000_core.c
> +++ b/drivers/staging/iio/accel/sca3000_core.c
> @@ -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;

2009-10-01 09:48:22

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 11:31:06AM +0200, Uwe Kleine-K?nig wrote:
> Hello,
>
> On Thu, Oct 01, 2009 at 11:12:18AM +0200, Michael S. Tsirkin wrote:
> > On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> > > Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > > > The function virtrng_remove is used only wrapped by __devexit_p so define
> > > > it using __devexit.
> > > >
> > > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > > > Acked-by: Sam Ravnborg <[email protected]>
> > > > Cc: Rusty Russell <[email protected]>
> > > > Cc: Michael S. Tsirkin <[email protected]>
> > > > Cc: Christian Borntraeger <[email protected]>
> > >
> > > Acked-by: Christian Borntraeger <[email protected]>
> >
> > FWIW
> > Acked-by: Michael S. Tsirkin <[email protected]>
> ok
>
> > > 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
>
> > 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.

And MODULE.

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

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


> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-K?nig |
> Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 09:52:08

by Uwe Kleine-König

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

Hello Michael,

On Thu, Oct 01, 2009 at 11:35:48AM +0200, Michael S. Tsirkin wrote:
> On Thu, Oct 01, 2009 at 10:28:33AM +0200, Uwe Kleine-K?nig wrote:
> > The function virtballoon_remove is used only wrapped by __devexit_p so
> > define it using __devexit.
> >
> > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > Acked-by: Sam Ravnborg <[email protected]>
> > Cc: Rusty Russell <[email protected]>
> > Cc: Michael S. Tsirkin <[email protected]>
> > Cc: [email protected]
>
> Acked-by: Michael S. Tsirkin <[email protected]>
>
> Generally I think all remove pointers on virtio bus are devexit.
That means I missed something?

> How do
> you find all these,
I have a script that only generates few false-positives (and an unknown
number of false-negatives).

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

> 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 10:09:34

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 11:52:09AM +0200, Uwe Kleine-K?nig wrote:
> Hello Michael,
>
> On Thu, Oct 01, 2009 at 11:35:48AM +0200, Michael S. Tsirkin wrote:
> > On Thu, Oct 01, 2009 at 10:28:33AM +0200, Uwe Kleine-K?nig wrote:
> > > The function virtballoon_remove is used only wrapped by __devexit_p so
> > > define it using __devexit.
> > >
> > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > > Acked-by: Sam Ravnborg <[email protected]>
> > > Cc: Rusty Russell <[email protected]>
> > > Cc: Michael S. Tsirkin <[email protected]>
> > > Cc: [email protected]
> >
> > Acked-by: Michael S. Tsirkin <[email protected]>
> >
> > Generally I think all remove pointers on virtio bus are devexit.
> That means I missed something?


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

2009-10-01 10:17:27

by Uwe Kleine-König

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

Hello,

On Thu, Oct 01, 2009 at 11:45:18AM +0200, Michael S. Tsirkin wrote:
> On Thu, Oct 01, 2009 at 11:31:06AM +0200, Uwe Kleine-K?nig wrote:
> > Hello,
> >
> > On Thu, Oct 01, 2009 at 11:12:18AM +0200, Michael S. Tsirkin wrote:
> > > On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> > > > Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > > > > The function virtrng_remove is used only wrapped by __devexit_p so define
> > > > > it using __devexit.
> > > > >
> > > > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > > > > Acked-by: Sam Ravnborg <[email protected]>
> > > > > Cc: Rusty Russell <[email protected]>
> > > > > Cc: Michael S. Tsirkin <[email protected]>
> > > > > Cc: Christian Borntraeger <[email protected]>
> > > >
> > > > Acked-by: Christian Borntraeger <[email protected]>
> > >
> > > FWIW
> > > Acked-by: Michael S. Tsirkin <[email protected]>
> > ok
> >
> > > > 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
> >
> > > 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.
>
> 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.

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

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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 12:35:02

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 12:17:27PM +0200, Uwe Kleine-K?nig wrote:
> Hello,
>
> On Thu, Oct 01, 2009 at 11:45:18AM +0200, Michael S. Tsirkin wrote:
> > On Thu, Oct 01, 2009 at 11:31:06AM +0200, Uwe Kleine-K?nig wrote:
> > > Hello,
> > >
> > > On Thu, Oct 01, 2009 at 11:12:18AM +0200, Michael S. Tsirkin wrote:
> > > > On Thu, Oct 01, 2009 at 10:44:48AM +0200, Christian Borntraeger wrote:
> > > > > Am Donnerstag 01 Oktober 2009 10:28:35 schrieb Uwe Kleine-K?nig:
> > > > > > The function virtrng_remove is used only wrapped by __devexit_p so define
> > > > > > it using __devexit.
> > > > > >
> > > > > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> > > > > > Acked-by: Sam Ravnborg <[email protected]>
> > > > > > Cc: Rusty Russell <[email protected]>
> > > > > > Cc: Michael S. Tsirkin <[email protected]>
> > > > > > Cc: Christian Borntraeger <[email protected]>
> > > > >
> > > > > Acked-by: Christian Borntraeger <[email protected]>
> > > >
> > > > FWIW
> > > > Acked-by: Michael S. Tsirkin <[email protected]>
> > > ok
> > >
> > > > > 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
> > >
> > > > 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.
> >
> > 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.
>
> > > 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.
>
> > > 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.

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?


> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-K?nig |
> Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 14:11:46

by Altobelli, David

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


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

Acked-by: David Altobelli <[email protected]>

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

2009-10-01 14:20:07

by James Bottomley

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

On Thu, 2009-10-01 at 10:28 +0200, Uwe Kleine-König wrote:
> 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

2009-10-01 17:28:45

by Samuel Ortiz

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

Hi Uwe,

On Thu, Oct 01, 2009 at 10:28:05AM +0200, Uwe Kleine-K?nig wrote:
> The function asic3_remove is used only wrapped by __devexit_p so define
> it using __devexit.
Applied to the mfd tree, thanks.

Cheers,
Samuel.

> Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>
> Cc: Samuel Ortiz <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Yinghai Lu <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: [email protected]
> ---
> drivers/mfd/asic3.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
> index 63a2a66..e22128c 100644
> --- a/drivers/mfd/asic3.c
> +++ b/drivers/mfd/asic3.c
> @@ -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);
> --
> 1.6.4.3
>

--
Intel Open Source Technology Centre
http://oss.intel.com/

2009-10-01 17:41:17

by Uwe Kleine-König

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

Hello Michael,

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

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

> 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 17:44:48

by Uwe Kleine-König

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

Hello David,

On Thu, Oct 01, 2009 at 02:10:27PM +0000, Altobelli, David wrote:
> > 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 17:50:07

by Altobelli, David

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

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

2009-10-01 18:07:57

by Michael S. Tsirkin

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

On Thu, Oct 01, 2009 at 07:41:16PM +0200, Uwe Kleine-K?nig wrote:
> Hello Michael,
>
> > > 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.
>
> > 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.
>
> > 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?

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

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.

> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-K?nig |
> Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-01 18:19:19

by Uwe Kleine-König

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

Hello Michael,

On Thu, Oct 01, 2009 at 08:05:00PM +0200, Michael S. Tsirkin wrote:
> On Thu, Oct 01, 2009 at 07:41:16PM +0200, Uwe Kleine-K?nig wrote:
> > Hello Michael,
> >
> > > > 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.
> >
> > > 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.
> >
> > > 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.

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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-02 00:54:04

by Greg Ungerer

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

Hi Uwe,

Uwe Kleine-König wrote:
> The function mcf_remove is used only wrapped by __devexit_p so define it
> using __devexit.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Cc: Greg Ungerer <[email protected]>
> Cc: Len Sorensen <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Alan Cox <[email protected]>
> Cc: [email protected]
> ---
> drivers/serial/mcf.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c
> index b443824..7bb5fee 100644
> --- a/drivers/serial/mcf.c
> +++ b/drivers/serial/mcf.c
> @@ -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

2009-10-02 07:21:02

by Ben Dooks

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

Uwe Kleine-König wrote:
> The function s3c_adc_remove is used only wrapped by __devexit_p so define
> it using __devexit.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: Ben Dooks <[email protected]>
Acked-By: Ben Dooks <[email protected]>
> Cc: Ramax Lo <[email protected]>
> Cc: Nelson Castillo <[email protected]>
> Cc: [email protected]

--
Ben Dooks, Software Engineer, Simtec Electronics

http://www.simtec.co.uk/

2009-10-02 09:02:55

by Takashi Iwai

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

At Thu, 1 Oct 2009 10:53:55 +0200,
Uwe Kleine-König wrote:
>
> On Thu, Oct 01, 2009 at 10:36:59AM +0200, Takashi Iwai wrote:
> > At Thu, 1 Oct 2009 10:28:10 +0200,
> > Uwe Kleine-König wrote:
> > >
> > > 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.

> 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

2009-10-02 09:20:31

by Uwe Kleine-König

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

Hello,

On Fri, Oct 02, 2009 at 11:02:56AM +0200, Takashi Iwai wrote:
> At Thu, 1 Oct 2009 10:53:55 +0200,
> Uwe Kleine-K?nig wrote:
> >
> > On Thu, Oct 01, 2009 at 10:36:59AM +0200, Takashi Iwai wrote:
> > > At Thu, 1 Oct 2009 10:28:10 +0200,
> > > Uwe Kleine-K?nig wrote:
> > > >
> > > > 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.
I just tried that and you're right. IMHO that's a bug. Greg?

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-02 09:42:55

by Takashi Iwai

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

At Fri, 2 Oct 2009 11:20:25 +0200,
Uwe Kleine-König wrote:
>
> Hello,
>
> On Fri, Oct 02, 2009 at 11:02:56AM +0200, Takashi Iwai wrote:
> > At Thu, 1 Oct 2009 10:53:55 +0200,
> > Uwe Kleine-König wrote:
> > >
> > > On Thu, Oct 01, 2009 at 10:36:59AM +0200, Takashi Iwai wrote:
> > > > At Thu, 1 Oct 2009 10:28:10 +0200,
> > > > Uwe Kleine-König wrote:
> > > > >
> > > > > 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.
> 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

2009-10-02 19:13:24

by Uwe Kleine-König

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

Hello,

On Thu, Oct 01, 2009 at 02:20:02PM +0000, James Bottomley wrote:
> 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

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

2009-10-06 05:06:38

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 05/34] move grover_remove to .devexit.text

On Thu, Oct 01, 2009 at 10:28:09AM +0200, Uwe Kleine-K?nig wrote:
> The function grover_remove is used only wrapped by __devexit_p so define
> it using __devexit.
>
> Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>

Folded together with your other patch to sparkspkr and applied.

Thanks Uwe.

--
Dmitry

2009-10-06 23:28:14

by Rusty Russell

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

On Thu, 1 Oct 2009 05:58:33 pm Uwe Kleine-König wrote:
> The function virtballoon_remove is used only wrapped by __devexit_p so
> define it using __devexit.

Thanks, applied!

Rusty.