* kobject.h with HOTPLUG=n
@ 2006-12-18 17:49 Randy Dunlap
2006-12-18 19:51 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2006-12-18 17:49 UTC (permalink / raw)
To: gregkh, linux-kernel, kay.sievers
In 2.6.20-rc1-mm1, with HOTPLUG=n, 2 linux/kobject.h inline functions
need to return <int>. Currently this causes 962 warnings like this:
include/linux/kobject.h: In function 'kobject_uevent':
include/linux/kobject.h:277: warning: no return statement in function returning non-void
include/linux/kobject.h: In function 'kobject_uevent_env':
include/linux/kobject.h:281: warning: no return statement in function returning non-void
Should these functions return 0 or some error code?
static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) { }
static inline int kobject_uevent_env(struct kobject *kobj,
enum kobject_action action,
char *envp[])
{ }
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kobject.h with HOTPLUG=n
2006-12-18 17:49 kobject.h with HOTPLUG=n Randy Dunlap
@ 2006-12-18 19:51 ` Greg KH
2006-12-18 20:41 ` [PATCH] " Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2006-12-18 19:51 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-kernel, kay.sievers
On Mon, Dec 18, 2006 at 09:49:24AM -0800, Randy Dunlap wrote:
> In 2.6.20-rc1-mm1, with HOTPLUG=n, 2 linux/kobject.h inline functions
> need to return <int>. Currently this causes 962 warnings like this:
>
> include/linux/kobject.h: In function 'kobject_uevent':
> include/linux/kobject.h:277: warning: no return statement in function
> returning non-void
> include/linux/kobject.h: In function 'kobject_uevent_env':
> include/linux/kobject.h:281: warning: no return statement in function
> returning non-void
>
> Should these functions return 0 or some error code?
>
> static inline int kobject_uevent(struct kobject *kobj, enum kobject_action
> action) { }
> static inline int kobject_uevent_env(struct kobject *kobj,
> enum kobject_action action,
> char *envp[])
> { }
They should just return 0. Care to make up a quick patch to fix this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] kobject.h with HOTPLUG=n
2006-12-18 19:51 ` Greg KH
@ 2006-12-18 20:41 ` Randy Dunlap
0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2006-12-18 20:41 UTC (permalink / raw)
To: Greg KH, akpm; +Cc: linux-kernel, kay.sievers
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix inline kobject functions to return 0 when CONFIG_HOTPLUG=n.
include/linux/kobject.h: In function 'kobject_uevent':
include/linux/kobject.h:277: warning: no return statement in function returning non-void
include/linux/kobject.h: In function 'kobject_uevent_env':
include/linux/kobject.h:281: warning: no return statement in function returning non-void
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
include/linux/kobject.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- linux-2.6.20-rc1-mm1.orig/include/linux/kobject.h
+++ linux-2.6.20-rc1-mm1/include/linux/kobject.h
@@ -274,11 +274,12 @@ int add_uevent_var(char **envp, int num_
const char *format, ...)
__attribute__((format (printf, 7, 8)));
#else
-static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) { }
+static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action)
+{ return 0; }
static inline int kobject_uevent_env(struct kobject *kobj,
enum kobject_action action,
char *envp[])
-{ }
+{ return 0; }
static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
char *buffer, int buffer_size, int *cur_len,
---
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-18 20:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18 17:49 kobject.h with HOTPLUG=n Randy Dunlap
2006-12-18 19:51 ` Greg KH
2006-12-18 20:41 ` [PATCH] " Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox