kobject.h with HOTPLUG=n
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[])
{ }
Signature · 1 line
~Randy
Quoted 10 lines · Randy Dunlap
In 2.6.20-rc1-mm1, with HOTPLUG=n, 2
linux/kobject.hinline 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-voidinclude/linux/kobject.h: In function 'kobject_uevent_env':include/linux/kobject.h:281: warning: no return statement in function returning non-void
Quoted 8 lines
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
PATCH 1/1 kobject.h with HOTPLUG=n
From: Randy Dunlap <[email protected]>
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
--- include/linux/kobject.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/kobject.h +3 -2
@@ -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,
---