2015-05-02 16:01:38

by Fabian Frédérick

[permalink] [raw]
Subject: [PATCH 1/1 linux-next] PNP: move EXPORT_SYMBOL after functions

EXPORT macro must be placed directly after functions.
See Documentation/CodingStyle Chapter 6

Signed-off-by: Fabian Frederick <[email protected]>
---
drivers/pnp/driver.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 153a493..b690e6b 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -67,6 +67,7 @@ int pnp_device_attach(struct pnp_dev *pnp_dev)
mutex_unlock(&pnp_lock);
return 0;
}
+EXPORT_SYMBOL(pnp_device_attach);

void pnp_device_detach(struct pnp_dev *pnp_dev)
{
@@ -76,6 +77,7 @@ void pnp_device_detach(struct pnp_dev *pnp_dev)
mutex_unlock(&pnp_lock);
pnp_disable_dev(pnp_dev);
}
+EXPORT_SYMBOL(pnp_device_detach);

static int pnp_device_probe(struct device *dev)
{
@@ -266,11 +268,13 @@ int pnp_register_driver(struct pnp_driver *drv)

return driver_register(&drv->driver);
}
+EXPORT_SYMBOL(pnp_register_driver);

void pnp_unregister_driver(struct pnp_driver *drv)
{
driver_unregister(&drv->driver);
}
+EXPORT_SYMBOL(pnp_unregister_driver);

/**
* pnp_add_id - adds an EISA id to the specified device
@@ -305,8 +309,3 @@ struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id)

return dev_id;
}
-
-EXPORT_SYMBOL(pnp_register_driver);
-EXPORT_SYMBOL(pnp_unregister_driver);
-EXPORT_SYMBOL(pnp_device_attach);
-EXPORT_SYMBOL(pnp_device_detach);
--
1.9.1


2015-05-04 21:05:38

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH 1/1 linux-next] PNP: move EXPORT_SYMBOL after functions

On Saturday, May 02, 2015 06:01:21 PM Fabian Frederick wrote:
> EXPORT macro must be placed directly after functions.
> See Documentation/CodingStyle Chapter 6

Well, why is this change an improvement?

Yes, it makes an old file follow the new(er) Documentation/CodingStyl,
but what exactly is the benefit?

Mind you, there are more files with EXPORT_SYMBOL(_GPL) at the end.
Are you going to hunt for them now or something?


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

2015-05-05 17:39:15

by Fabian Frédérick

[permalink] [raw]
Subject: Re: [PATCH 1/1 linux-next] PNP: move EXPORT_SYMBOL after functions



> On 04 May 2015 at 23:30 "Rafael J. Wysocki" <[email protected]> wrote:
>
>
> On Saturday, May 02, 2015 06:01:21 PM Fabian Frederick wrote:
> > EXPORT macro must be placed directly after functions.
> > See Documentation/CodingStyle Chapter 6
>
> Well, why is this change an improvement?
>
> Yes, it makes an old file follow the new(er) Documentation/CodingStyl,
> but what exactly is the benefit?
>
> Mind you, there are more files with EXPORT_SYMBOL(_GPL) at the end.
> Are you going to hunt for them now or something?

Hi Rafael,
       
        AFAIK it just brings more readability. I sent you this one while fixing
warnings in 2 PNPACPI patches but of course you can ignore it :)
Fortunately, I don't plan to send a patch for each EXPORT_SYMBOL(_GPL) "problem"
:)

Regards,
Fabian

>
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.