2009-12-22 08:29:28

by Peter Huewe

[permalink] [raw]
Subject: [PATCH 1/2] misc: add __init/__exit macros to drivers/misc/hwlat_detector.c

From: Peter Huewe <[email protected]>

Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of

drivers/misc/hwlat_detector.c

Please have a look at the small patch and either pull it through
your tree, or please ack' it so Jiri can pull it through the trivial
tree.

Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
but also present in linus tree.

Signed-off-by: Peter Huewe <[email protected]>
---
drivers/misc/hwlat_detector.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/hwlat_detector.c b/drivers/misc/hwlat_detector.c
index e02d8e1..fd6fa6f 100644
--- a/drivers/misc/hwlat_detector.c
+++ b/drivers/misc/hwlat_detector.c
@@ -1163,7 +1163,7 @@ static void free_debugfs(void)
/**
* detector_init - Standard module initialization code
*/
-static int detector_init(void)
+static int __init detector_init(void)
{
int ret = -ENOMEM;

@@ -1192,7 +1192,7 @@ out:
/**
* detector_exit - Standard module cleanup code
*/
-static void detector_exit(void)
+static void __exit detector_exit(void)
{
if (enabled) {
enabled = 0;
--
1.6.4.4


2009-12-22 08:29:37

by Peter Huewe

[permalink] [raw]
Subject: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

From: Peter Huewe <[email protected]>

Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of

drivers/ide/scc_pata.c

Please have a look at the small patch and either pull it through
your tree, or please ack' it so Jiri can pull it through the trivial
tree.

Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
but also present in linus tree.

Signed-off-by: Peter Huewe <[email protected]>
---
drivers/ide/scc_pata.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index 1104bb3..58c9c91 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -872,14 +872,14 @@ static struct pci_driver scc_pci_driver = {
.remove = __devexit_p(scc_remove),
};

-static int scc_ide_init(void)
+static int __init scc_ide_init(void)
{
return ide_pci_register_driver(&scc_pci_driver);
}

module_init(scc_ide_init);
/* -- No exit code?
-static void scc_ide_exit(void)
+static void __exit scc_ide_exit(void)
{
ide_pci_unregister_driver(&scc_pci_driver);
}
--
1.6.4.4

2009-12-22 13:03:10

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 1/2] misc: add __init/__exit macros to drivers/misc/hwlat_detector.c

Hello,

On Tue, Dec 22, 2009 at 09:29:23AM +0100, [email protected] wrote:
> From: Peter Huewe <[email protected]>
>
> Trivial patch which adds the __init/__exit macros to the module_init/
> module_exit functions of
>
> drivers/misc/hwlat_detector.c
>
> Please have a look at the small patch and either pull it through
> your tree, or please ack' it so Jiri can pull it through the trivial
> tree.
>
> Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
> but also present in linus tree.
>
> Signed-off-by: Peter Huewe <[email protected]>
> ---
The commit log contains some things that are maybe interesting in this
mail, but not in git (base tree, plea to look, exact filename).

Apart from Acked-by: Uwe Kleine-K?nig <[email protected]>

Best regards
Uwe

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

2009-12-22 13:17:38

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 1/2] misc: add __init/__exit macros to drivers/misc/hwlat_detector.c

On Tue, 22 Dec 2009, Uwe Kleine-K?nig wrote:

> > Trivial patch which adds the __init/__exit macros to the module_init/
> > module_exit functions of
> >
> > drivers/misc/hwlat_detector.c
> >
> > Please have a look at the small patch and either pull it through
> > your tree, or please ack' it so Jiri can pull it through the trivial
> > tree.
> >
> > Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
> > but also present in linus tree.
> >
> > Signed-off-by: Peter Huewe <[email protected]>
> > ---
> The commit log contains some things that are maybe interesting in this
> mail, but not in git (base tree, plea to look, exact filename).
>
> Apart from Acked-by: Uwe Kleine-K?nig <[email protected]>

The changelog claims that this is against current Linus' tree and patches
drivers/misc/hwlat_detector.c file, but I can't seem to see anything
similar in current Linus' tree (HEAD on f7b84a6ba7e).

$ find . -name hwlat_detector.c
$

--
Jiri Kosina
SUSE Labs, Novell Inc.

2009-12-22 13:31:07

by Jon Masters

[permalink] [raw]
Subject: Re: [PATCH 1/2] misc: add __init/__exit macros to drivers/misc/hwlat_detector.c

On Tue, 2009-12-22 at 14:02 +0100, Uwe Kleine-König wrote:
> Hello,
>
> On Tue, Dec 22, 2009 at 09:29:23AM +0100, [email protected] wrote:
> > From: Peter Huewe <[email protected]>
> >
> > Trivial patch which adds the __init/__exit macros to the module_init/
> > module_exit functions of
> >
> > drivers/misc/hwlat_detector.c
> >
> > Please have a look at the small patch and either pull it through
> > your tree, or please ack' it so Jiri can pull it through the trivial
> > tree.
> >
> > Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
> > but also present in linus tree.
> >
> > Signed-off-by: Peter Huewe <[email protected]>
> > ---
> The commit log contains some things that are maybe interesting in this
> mail, but not in git (base tree, plea to look, exact filename).
>
> Apart from Acked-by: Uwe Kleine-König <[email protected]>

I'll get to this later. Just spent 2 days (should have been 10 hours
door to door) traveling to the UK in the worst storms for ten years on
*both* sides of the atlantic. Currently rediscovering sleep ;)

Jon.

2010-01-05 10:25:21

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

On Tue, 22 Dec 2009, [email protected] wrote:

> From: Peter Huewe <[email protected]>
>
> Trivial patch which adds the __init/__exit macros to the module_init/
> module_exit functions of
>
> drivers/ide/scc_pata.c
>
> Please have a look at the small patch and either pull it through
> your tree, or please ack' it so Jiri can pull it through the trivial
> tree.
>
> Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
> but also present in linus tree.
>
> Signed-off-by: Peter Huewe <[email protected]>
> ---
> drivers/ide/scc_pata.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
> index 1104bb3..58c9c91 100644
> --- a/drivers/ide/scc_pata.c
> +++ b/drivers/ide/scc_pata.c
> @@ -872,14 +872,14 @@ static struct pci_driver scc_pci_driver = {
> .remove = __devexit_p(scc_remove),
> };
>
> -static int scc_ide_init(void)
> +static int __init scc_ide_init(void)
> {
> return ide_pci_register_driver(&scc_pci_driver);
> }
>
> module_init(scc_ide_init);
> /* -- No exit code?
> -static void scc_ide_exit(void)
> +static void __exit scc_ide_exit(void)
> {
> ide_pci_unregister_driver(&scc_pci_driver);
> }

This code is commented out anyway. So we should either nuke it out
completely if it is not needed, or uncomment and fix.

Bartlomiej, David?

--
Jiri Kosina
SUSE Labs, Novell Inc.

Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

On Tuesday 05 January 2010 11:25:13 am Jiri Kosina wrote:
> On Tue, 22 Dec 2009, [email protected] wrote:
>
> > From: Peter Huewe <[email protected]>
> >
> > Trivial patch which adds the __init/__exit macros to the module_init/
> > module_exit functions of
> >
> > drivers/ide/scc_pata.c
> >
> > Please have a look at the small patch and either pull it through
> > your tree, or please ack' it so Jiri can pull it through the trivial
> > tree.
> >
> > Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
> > but also present in linus tree.
> >
> > Signed-off-by: Peter Huewe <[email protected]>
> > ---
> > drivers/ide/scc_pata.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
> > index 1104bb3..58c9c91 100644
> > --- a/drivers/ide/scc_pata.c
> > +++ b/drivers/ide/scc_pata.c
> > @@ -872,14 +872,14 @@ static struct pci_driver scc_pci_driver = {
> > .remove = __devexit_p(scc_remove),
> > };
> >
> > -static int scc_ide_init(void)
> > +static int __init scc_ide_init(void)
> > {
> > return ide_pci_register_driver(&scc_pci_driver);
> > }
> >
> > module_init(scc_ide_init);
> > /* -- No exit code?
> > -static void scc_ide_exit(void)
> > +static void __exit scc_ide_exit(void)
> > {
> > ide_pci_unregister_driver(&scc_pci_driver);
> > }
>
> This code is commented out anyway. So we should either nuke it out
> completely if it is not needed, or uncomment and fix.
>
> Bartlomiej, David?

We can fix it nowadays, though I worry that by fixing it we may be 'creating
competition' for 'officially blessed yet unmaintained' PATA stack... 8-)

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] scc_pata: fix module unloading

scc_pata host driver predated module unloading support for IDE host
drivers so even though it supports PCI hot-unplug and implements
PCI device ->remove method it doesn't allow module removal. Fix it.

Add missing __init/__exit tags to module_init/module_exit functions
while at it (from Peter Huewe).

Noticed-by: Jiri Kosina <[email protected]>
Cc: Peter Huewe <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
---
drivers/ide/scc_pata.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -872,20 +872,18 @@ static struct pci_driver scc_pci_driver
.remove = __devexit_p(scc_remove),
};

-static int scc_ide_init(void)
+static int __init scc_ide_init(void)
{
return ide_pci_register_driver(&scc_pci_driver);
}

-module_init(scc_ide_init);
-/* -- No exit code?
-static void scc_ide_exit(void)
+static void __exit scc_ide_exit(void)
{
- ide_pci_unregister_driver(&scc_pci_driver);
+ pci_unregister_driver(&scc_pci_driver);
}
-module_exit(scc_ide_exit);
- */

+module_init(scc_ide_init);
+module_exit(scc_ide_exit);

MODULE_DESCRIPTION("PCI driver module for Toshiba SCC IDE");
MODULE_LICENSE("GPL");

2010-01-06 20:28:22

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

From: Bartlomiej Zolnierkiewicz <[email protected]>
Date: Tue, 5 Jan 2010 19:39:07 +0100

> We can fix it nowadays, though I worry that by fixing it we may be 'creating
> competition' for 'officially blessed yet unmaintained' PATA stack... 8-)

Not being able to unload a module is a bug isn't it? Bug fixes
are always fine :-)

I'll take a closer look at this then apply it, thanks Bart!

2010-01-06 20:58:17

by Peter Huewe

[permalink] [raw]
Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

Am Mittwoch 06 Januar 2010 21:28:26 schrieb David Miller:
> From: Bartlomiej Zolnierkiewicz <[email protected]>
> Date: Tue, 5 Jan 2010 19:39:07 +0100
>
>
> Not being able to unload a module is a bug isn't it? Bug fixes
> are always fine :-)
>
> I'll take a closer look at this then apply it, thanks Bart!

Funny what such trivial patch can reveal :)

Regards,
Peter

2010-01-08 08:12:56

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

From: Bartlomiej Zolnierkiewicz <[email protected]>
Date: Tue, 5 Jan 2010 19:39:07 +0100

> - ide_pci_unregister_driver(&scc_pci_driver);
> + pci_unregister_driver(&scc_pci_driver);

As a side note I can't figure out how this driver can currently even
build without errors before this patch.

ide_pci_unregister_driver() isn't even defined anywhere these days.

2010-01-08 08:14:12

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 2/2] ide: add __init/__exit macros to drivers/ide/scc_pata.c

From: David Miller <[email protected]>
Date: Fri, 08 Jan 2010 00:13:02 -0800 (PST)

> From: Bartlomiej Zolnierkiewicz <[email protected]>
> Date: Tue, 5 Jan 2010 19:39:07 +0100
>
>> - ide_pci_unregister_driver(&scc_pci_driver);
>> + pci_unregister_driver(&scc_pci_driver);
>
> As a side note I can't figure out how this driver can currently even
> build without errors before this patch.
>
> ide_pci_unregister_driver() isn't even defined anywhere these days.

Ignore me, I'm an idiot, this code was commented out of course.
:-)