public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/base/: proper prototypes
@ 2006-01-19  1:32 Adrian Bunk
  2006-01-19  2:51 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2006-01-19  1:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

This patch contains the following changes:
- move prototypes to base.h
- sys.c should #include "base.h" for getting the prototype of it's
  global function system_bus_init()

Note that hidden in this patch there's a bugfix:

Caller and callee disagreed regarding the return type of 
sysdev_shutdown().


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/base/base.h           |    6 ++++++
 drivers/base/power/resume.c   |    3 +--
 drivers/base/power/shutdown.c |    2 +-
 drivers/base/power/suspend.c  |    3 +--
 drivers/base/sys.c            |    2 ++
 5 files changed, 11 insertions(+), 5 deletions(-)

--- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
@@ -1,6 +1,8 @@
 
 /* initialisation functions */
 
+#include <linux/device.h>
+
 extern int devices_init(void);
 extern int buses_init(void);
 extern int classes_init(void);
@@ -19,6 +21,10 @@
 extern void driver_detach(struct device_driver * drv);
 extern int driver_probe_device(struct device_driver *, struct device *);
 
+extern void sysdev_shutdown(void);
+extern int sysdev_suspend(pm_message_t state);
+extern int sysdev_resume(void);
+
 static inline struct class_device *to_class_dev(struct kobject *obj)
 {
 	return container_of(obj, struct class_device, kobj);
--- linux-2.6.16-rc1-mm1-full/drivers/base/sys.c.old	2006-01-18 23:18:38.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/sys.c	2006-01-18 23:20:04.000000000 +0100
@@ -23,6 +23,8 @@
 #include <linux/pm.h>
 #include <asm/semaphore.h>
 
+#include "base.h"
+
 extern struct subsystem devices_subsys;
 
 #define to_sysdev(k) container_of(k, struct sys_device, kobj)
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/shutdown.c.old	2006-01-18 23:18:56.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/shutdown.c	2006-01-18 23:43:45.000000000 +0100
@@ -12,6 +12,7 @@
 #include <linux/device.h>
 #include <asm/semaphore.h>
 
+#include "../base.h"
 #include "power.h"
 
 #define to_dev(node) container_of(node, struct device, kobj.entry)
@@ -28,7 +29,6 @@
  * they only get one called once when interrupts are disabled.
  */
 
-extern int sysdev_shutdown(void);
 
 /**
  * device_shutdown - call ->shutdown() on each device to shutdown.
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/suspend.c.old	2006-01-18 23:20:16.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/suspend.c	2006-01-18 23:43:51.000000000 +0100
@@ -9,10 +9,9 @@
  */
 
 #include <linux/device.h>
+#include "../base.h"
 #include "power.h"
 
-extern int sysdev_suspend(pm_message_t state);
-
 /*
  * The entries in the dpm_active list are in a depth first order, simply
  * because children are guaranteed to be discovered after parents, and
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/resume.c.old	2006-01-18 23:20:26.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/resume.c	2006-01-18 23:43:58.000000000 +0100
@@ -9,10 +9,9 @@
  */
 
 #include <linux/device.h>
+#include "../base.h"
 #include "power.h"
 
-extern int sysdev_resume(void);
-
 
 /**
  *	resume_device - Restore state for one device.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  1:32 [2.6 patch] drivers/base/: proper prototypes Adrian Bunk
@ 2006-01-19  2:51 ` Greg KH
  2006-01-19  3:28   ` Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2006-01-19  2:51 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Thu, Jan 19, 2006 at 02:32:42AM +0100, Adrian Bunk wrote:
> This patch contains the following changes:
> - move prototypes to base.h
> - sys.c should #include "base.h" for getting the prototype of it's
>   global function system_bus_init()
> 
> Note that hidden in this patch there's a bugfix:
> 
> Caller and callee disagreed regarding the return type of 
> sysdev_shutdown().
> 
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> 
>  drivers/base/base.h           |    6 ++++++
>  drivers/base/power/resume.c   |    3 +--
>  drivers/base/power/shutdown.c |    2 +-
>  drivers/base/power/suspend.c  |    3 +--
>  drivers/base/sys.c            |    2 ++
>  5 files changed, 11 insertions(+), 5 deletions(-)
> 
> --- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
> +++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
> @@ -1,6 +1,8 @@
>  
>  /* initialisation functions */
>  
> +#include <linux/device.h>
> +

Why is this extra #include needed?  It shouldn't be.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  2:51 ` Greg KH
@ 2006-01-19  3:28   ` Adrian Bunk
  2006-01-19  3:35     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2006-01-19  3:28 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Wed, Jan 18, 2006 at 06:51:47PM -0800, Greg KH wrote:
> On Thu, Jan 19, 2006 at 02:32:42AM +0100, Adrian Bunk wrote:
> > This patch contains the following changes:
> > - move prototypes to base.h
> > - sys.c should #include "base.h" for getting the prototype of it's
> >   global function system_bus_init()
> > 
> > Note that hidden in this patch there's a bugfix:
> > 
> > Caller and callee disagreed regarding the return type of 
> > sysdev_shutdown().
> > 
> > 
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > 
> > ---
> > 
> >  drivers/base/base.h           |    6 ++++++
> >  drivers/base/power/resume.c   |    3 +--
> >  drivers/base/power/shutdown.c |    2 +-
> >  drivers/base/power/suspend.c  |    3 +--
> >  drivers/base/sys.c            |    2 ++
> >  5 files changed, 11 insertions(+), 5 deletions(-)
> > 
> > --- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
> > +++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
> > @@ -1,6 +1,8 @@
> >  
> >  /* initialisation functions */
> >  
> > +#include <linux/device.h>
> > +
> 
> Why is this extra #include needed?  It shouldn't be.

struct class_device and struct class_device_attribute are needed since 
they are used in base.h .

> thanks,
> 
> greg k-h

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  3:28   ` Adrian Bunk
@ 2006-01-19  3:35     ` Greg KH
  2006-01-19  3:40       ` Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2006-01-19  3:35 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Thu, Jan 19, 2006 at 04:28:08AM +0100, Adrian Bunk wrote:
> On Wed, Jan 18, 2006 at 06:51:47PM -0800, Greg KH wrote:
> > On Thu, Jan 19, 2006 at 02:32:42AM +0100, Adrian Bunk wrote:
> > > This patch contains the following changes:
> > > - move prototypes to base.h
> > > - sys.c should #include "base.h" for getting the prototype of it's
> > >   global function system_bus_init()
> > > 
> > > Note that hidden in this patch there's a bugfix:
> > > 
> > > Caller and callee disagreed regarding the return type of 
> > > sysdev_shutdown().
> > > 
> > > 
> > > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > > 
> > > ---
> > > 
> > >  drivers/base/base.h           |    6 ++++++
> > >  drivers/base/power/resume.c   |    3 +--
> > >  drivers/base/power/shutdown.c |    2 +-
> > >  drivers/base/power/suspend.c  |    3 +--
> > >  drivers/base/sys.c            |    2 ++
> > >  5 files changed, 11 insertions(+), 5 deletions(-)
> > > 
> > > --- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
> > > +++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
> > > @@ -1,6 +1,8 @@
> > >  
> > >  /* initialisation functions */
> > >  
> > > +#include <linux/device.h>
> > > +
> > 
> > Why is this extra #include needed?  It shouldn't be.
> 
> struct class_device and struct class_device_attribute are needed since 
> they are used in base.h .

But anyone who includes base.h will have already included this header
file, right?  That was my point.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  3:35     ` Greg KH
@ 2006-01-19  3:40       ` Adrian Bunk
  2006-01-19  4:07         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2006-01-19  3:40 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Wed, Jan 18, 2006 at 07:35:32PM -0800, Greg KH wrote:
> On Thu, Jan 19, 2006 at 04:28:08AM +0100, Adrian Bunk wrote:
> > On Wed, Jan 18, 2006 at 06:51:47PM -0800, Greg KH wrote:
> > > On Thu, Jan 19, 2006 at 02:32:42AM +0100, Adrian Bunk wrote:
> > > > This patch contains the following changes:
> > > > - move prototypes to base.h
> > > > - sys.c should #include "base.h" for getting the prototype of it's
> > > >   global function system_bus_init()
> > > > 
> > > > Note that hidden in this patch there's a bugfix:
> > > > 
> > > > Caller and callee disagreed regarding the return type of 
> > > > sysdev_shutdown().
> > > > 
> > > > 
> > > > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > > > 
> > > > ---
> > > > 
> > > >  drivers/base/base.h           |    6 ++++++
> > > >  drivers/base/power/resume.c   |    3 +--
> > > >  drivers/base/power/shutdown.c |    2 +-
> > > >  drivers/base/power/suspend.c  |    3 +--
> > > >  drivers/base/sys.c            |    2 ++
> > > >  5 files changed, 11 insertions(+), 5 deletions(-)
> > > > 
> > > > --- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
> > > > +++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
> > > > @@ -1,6 +1,8 @@
> > > >  
> > > >  /* initialisation functions */
> > > >  
> > > > +#include <linux/device.h>
> > > > +
> > > 
> > > Why is this extra #include needed?  It shouldn't be.
> > 
> > struct class_device and struct class_device_attribute are needed since 
> > they are used in base.h .
> 
> But anyone who includes base.h will have already included this header
> file, right?  That was my point.

drivers/base/sys.c doesn't (this is why I noticed it).

> thanks,
> 
> greg k-h

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  3:40       ` Adrian Bunk
@ 2006-01-19  4:07         ` Greg KH
  2006-01-19 16:30           ` Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2006-01-19  4:07 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Thu, Jan 19, 2006 at 04:40:11AM +0100, Adrian Bunk wrote:
> On Wed, Jan 18, 2006 at 07:35:32PM -0800, Greg KH wrote:
> > On Thu, Jan 19, 2006 at 04:28:08AM +0100, Adrian Bunk wrote:
> > > On Wed, Jan 18, 2006 at 06:51:47PM -0800, Greg KH wrote:
> > > > On Thu, Jan 19, 2006 at 02:32:42AM +0100, Adrian Bunk wrote:
> > > > > This patch contains the following changes:
> > > > > - move prototypes to base.h
> > > > > - sys.c should #include "base.h" for getting the prototype of it's
> > > > >   global function system_bus_init()
> > > > > 
> > > > > Note that hidden in this patch there's a bugfix:
> > > > > 
> > > > > Caller and callee disagreed regarding the return type of 
> > > > > sysdev_shutdown().
> > > > > 
> > > > > 
> > > > > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > > > > 
> > > > > ---
> > > > > 
> > > > >  drivers/base/base.h           |    6 ++++++
> > > > >  drivers/base/power/resume.c   |    3 +--
> > > > >  drivers/base/power/shutdown.c |    2 +-
> > > > >  drivers/base/power/suspend.c  |    3 +--
> > > > >  drivers/base/sys.c            |    2 ++
> > > > >  5 files changed, 11 insertions(+), 5 deletions(-)
> > > > > 
> > > > > --- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
> > > > > +++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-18 23:41:33.000000000 +0100
> > > > > @@ -1,6 +1,8 @@
> > > > >  
> > > > >  /* initialisation functions */
> > > > >  
> > > > > +#include <linux/device.h>
> > > > > +
> > > > 
> > > > Why is this extra #include needed?  It shouldn't be.
> > > 
> > > struct class_device and struct class_device_attribute are needed since 
> > > they are used in base.h .
> > 
> > But anyone who includes base.h will have already included this header
> > file, right?  That was my point.
> 
> drivers/base/sys.c doesn't (this is why I noticed it).

Then it would be easier to add it there, if needed, than adding it to
base.h where it will tried to be included twice for all of the other
driver core files :)

Care to redo it?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [2.6 patch] drivers/base/: proper prototypes
  2006-01-19  4:07         ` Greg KH
@ 2006-01-19 16:30           ` Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2006-01-19 16:30 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Wed, Jan 18, 2006 at 08:07:11PM -0800, Greg KH wrote:
> On Thu, Jan 19, 2006 at 04:40:11AM +0100, Adrian Bunk wrote:
> > 
> > drivers/base/sys.c doesn't (this is why I noticed it).
> 
> Then it would be easier to add it there, if needed, than adding it to
> base.h where it will tried to be included twice for all of the other
> driver core files :)
> 
> Care to redo it?

Updated patch below.

> thanks,
> 
> greg k-h

cu
Adrian


<--  snip  -->


This patch contains the following changes:
- move prototypes to base.h
- sys.c should #include "base.h" for getting the prototype of it's
  global function system_bus_init()

Note that hidden in this patch there's a bugfix:

Caller and callee disagreed regarding the return type of
sysdev_shutdown().


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/base/base.h           |    4 ++++
 drivers/base/power/resume.c   |    3 +--
 drivers/base/power/shutdown.c |    2 +-
 drivers/base/power/suspend.c  |    3 +--
 drivers/base/sys.c            |    3 +++
 5 files changed, 10 insertions(+), 5 deletions(-)

--- linux-2.6.16-rc1-mm1-full/drivers/base/base.h.old	2006-01-18 23:17:52.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/base.h	2006-01-19 17:06:08.000000000 +0100
@@ -19,6 +19,10 @@
 extern void driver_detach(struct device_driver * drv);
 extern int driver_probe_device(struct device_driver *, struct device *);
 
+extern void sysdev_shutdown(void);
+extern int sysdev_suspend(pm_message_t state);
+extern int sysdev_resume(void);
+
 static inline struct class_device *to_class_dev(struct kobject *obj)
 {
 	return container_of(obj, struct class_device, kobj);
--- linux-2.6.16-rc1-mm1-full/drivers/base/sys.c.old	2006-01-18 23:18:38.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/sys.c	2006-01-19 17:06:46.000000000 +0100
@@ -21,8 +21,11 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/pm.h>
+#include <linux/device.h>
 #include <asm/semaphore.h>
 
+#include "base.h"
+
 extern struct subsystem devices_subsys;
 
 #define to_sysdev(k) container_of(k, struct sys_device, kobj)
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/shutdown.c.old	2006-01-18 23:18:56.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/shutdown.c	2006-01-18 23:43:45.000000000 +0100
@@ -12,6 +12,7 @@
 #include <linux/device.h>
 #include <asm/semaphore.h>
 
+#include "../base.h"
 #include "power.h"
 
 #define to_dev(node) container_of(node, struct device, kobj.entry)
@@ -28,7 +29,6 @@
  * they only get one called once when interrupts are disabled.
  */
 
-extern int sysdev_shutdown(void);
 
 /**
  * device_shutdown - call ->shutdown() on each device to shutdown.
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/suspend.c.old	2006-01-18 23:20:16.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/suspend.c	2006-01-18 23:43:51.000000000 +0100
@@ -9,10 +9,9 @@
  */
 
 #include <linux/device.h>
+#include "../base.h"
 #include "power.h"
 
-extern int sysdev_suspend(pm_message_t state);
-
 /*
  * The entries in the dpm_active list are in a depth first order, simply
  * because children are guaranteed to be discovered after parents, and
--- linux-2.6.16-rc1-mm1-full/drivers/base/power/resume.c.old	2006-01-18 23:20:26.000000000 +0100
+++ linux-2.6.16-rc1-mm1-full/drivers/base/power/resume.c	2006-01-18 23:43:58.000000000 +0100
@@ -9,10 +9,9 @@
  */
 
 #include <linux/device.h>
+#include "../base.h"
 #include "power.h"
 
-extern int sysdev_resume(void);
-
 
 /**
  *	resume_device - Restore state for one device.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-01-19 16:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-19  1:32 [2.6 patch] drivers/base/: proper prototypes Adrian Bunk
2006-01-19  2:51 ` Greg KH
2006-01-19  3:28   ` Adrian Bunk
2006-01-19  3:35     ` Greg KH
2006-01-19  3:40       ` Adrian Bunk
2006-01-19  4:07         ` Greg KH
2006-01-19 16:30           ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox