diff mbox

[1/2] i2c: stub: move module_init/exit annotations to the proper place

Message ID 20170516112105.2793-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Under Review
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Wolfram Sang May 16, 2017, 11:21 a.m. UTC
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/i2c-stub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jean Delvare May 18, 2017, 7:58 a.m. UTC | #1
Hi Wolfram,

On Tue, 16 May 2017 13:21:04 +0200, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/i2c/i2c-stub.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-stub.c b/drivers/i2c/i2c-stub.c
> index 06af583d510150..0aa4d646f8fb26 100644
> --- a/drivers/i2c/i2c-stub.c
> +++ b/drivers/i2c/i2c-stub.c
> @@ -406,16 +406,15 @@ static int __init i2c_stub_init(void)
>  	i2c_stub_free();
>  	return ret;
>  }
> +module_init(i2c_stub_init);
>  
>  static void __exit i2c_stub_exit(void)
>  {
>  	i2c_del_adapter(&stub_adapter);
>  	i2c_stub_free();
>  }
> +module_exit(i2c_stub_exit);
>  
>  MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
>  MODULE_DESCRIPTION("I2C stub driver");
>  MODULE_LICENSE("GPL");
> -
> -module_init(i2c_stub_init);
> -module_exit(i2c_stub_exit);

I'm not sure on what you base your claim that this is the "proper
place". checkpatch doesn't complain about either, and if anything, the
original style (module_init/exit) at end of file seems a lot more
popular through the kernel tree.
Wolfram Sang May 18, 2017, 8:14 a.m. UTC | #2
Hi Jean,

> > -module_init(i2c_stub_init);
> > -module_exit(i2c_stub_exit);
> 
> I'm not sure on what you base your claim that this is the "proper
> place". checkpatch doesn't complain about either, and if anything, the
> original style (module_init/exit) at end of file seems a lot more
> popular through the kernel tree.

In my book, this is more "old-style" than "popular" ;) And while I am
quite sure my change is common these days (put annotations directly
behind the functions), I in deed cannot find any public reference for
that.

No strong feelings, I can drop it.

Thanks,

   Wolfram
diff mbox

Patch

diff --git a/drivers/i2c/i2c-stub.c b/drivers/i2c/i2c-stub.c
index 06af583d510150..0aa4d646f8fb26 100644
--- a/drivers/i2c/i2c-stub.c
+++ b/drivers/i2c/i2c-stub.c
@@ -406,16 +406,15 @@  static int __init i2c_stub_init(void)
 	i2c_stub_free();
 	return ret;
 }
+module_init(i2c_stub_init);
 
 static void __exit i2c_stub_exit(void)
 {
 	i2c_del_adapter(&stub_adapter);
 	i2c_stub_free();
 }
+module_exit(i2c_stub_exit);
 
 MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
 MODULE_DESCRIPTION("I2C stub driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_stub_init);
-module_exit(i2c_stub_exit);