diff mbox series

[v1,3/3] i2c: i801: Remove linux/init.h and sort headers

Message ID 20190613164529.63482-3-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series [v1,1/3] i2c: i801: Fix kernel crash in is_dell_system_with_lis3lv02d() | expand

Commit Message

Andy Shevchenko June 13, 2019, 4:45 p.m. UTC
There is no need to include linux/init.h when at the same time
we include linux/module.h.

Remove redundant inclusion.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-i801.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jean Delvare June 14, 2019, 2:30 p.m. UTC | #1
Hi Andy,

On Thu, 13 Jun 2019 19:45:29 +0300, Andy Shevchenko wrote:
> There is no need to include linux/init.h when at the same time
> we include linux/module.h.
> 
> Remove redundant inclusion.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/i2c/busses/i2c-i801.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 03100f5fc0e9..5613c1ef1af4 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -85,7 +85,6 @@
>  #include <linux/stddef.h>
>  #include <linux/delay.h>
>  #include <linux/ioport.h>
> -#include <linux/init.h>
>  #include <linux/i2c.h>
>  #include <linux/i2c-smbus.h>
>  #include <linux/acpi.h>

In my books, you should never rely on a header including for you
another header you need. Is there a reason for not following that
principle here?
Andy Shevchenko June 14, 2019, 2:47 p.m. UTC | #2
On Fri, Jun 14, 2019 at 04:30:41PM +0200, Jean Delvare wrote:
> On Thu, 13 Jun 2019 19:45:29 +0300, Andy Shevchenko wrote:
> > There is no need to include linux/init.h when at the same time
> > we include linux/module.h.
> > 
> > Remove redundant inclusion.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/i2c/busses/i2c-i801.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> > index 03100f5fc0e9..5613c1ef1af4 100644
> > --- a/drivers/i2c/busses/i2c-i801.c
> > +++ b/drivers/i2c/busses/i2c-i801.c
> > @@ -85,7 +85,6 @@
> >  #include <linux/stddef.h>
> >  #include <linux/delay.h>
> >  #include <linux/ioport.h>
> > -#include <linux/init.h>
> >  #include <linux/i2c.h>
> >  #include <linux/i2c-smbus.h>
> >  #include <linux/acpi.h>
> 
> In my books, you should never rely on a header including for you
> another header you need. Is there a reason for not following that
> principle here?

init.h vs. module.h is a special case. Otherwise I agree with you.
Jean Delvare June 15, 2019, 3:11 p.m. UTC | #3
On Fri, 14 Jun 2019 17:47:43 +0300, Andy Shevchenko wrote:
> On Fri, Jun 14, 2019 at 04:30:41PM +0200, Jean Delvare wrote:
> > In my books, you should never rely on a header including for you
> > another header you need. Is there a reason for not following that
> > principle here?  
> 
> init.h vs. module.h is a special case. Otherwise I agree with you.

Why? Where is this documented?
Andy Shevchenko June 15, 2019, 3:30 p.m. UTC | #4
On Sat, Jun 15, 2019 at 05:11:24PM +0200, Jean Delvare wrote:
> On Fri, 14 Jun 2019 17:47:43 +0300, Andy Shevchenko wrote:
> > On Fri, Jun 14, 2019 at 04:30:41PM +0200, Jean Delvare wrote:
> > > In my books, you should never rely on a header including for you
> > > another header you need. Is there a reason for not following that
> > > principle here?  
> > 
> > init.h vs. module.h is a special case. Otherwise I agree with you.
> 
> Why? Where is this documented?

Paul did this split in the

commit 0fd972a7d91d6e15393c449492a04d94c0b89351
Author: Paul Gortmaker <paul.gortmaker@windriver.com>
Date:   Fri May 1 20:13:42 2015 -0400

    module: relocate module_init from init.h to module.h

I have no idea where it should be documented if it's not. Let Paul speak.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 03100f5fc0e9..5613c1ef1af4 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -85,7 +85,6 @@ 
 #include <linux/stddef.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
-#include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/i2c-smbus.h>
 #include <linux/acpi.h>