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 |
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?
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.
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?
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 --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>
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(-)