cpuidle - sysfs : move declaration in the sysfs file
PATCH 1/1 cpuidle - sysfs : move declaration in the sysfs file
The structure cpuidle_state_kobj is not used anywhere except in the sysfs.c file. The definition of this structure is not needed in the cpuidle header file. This patch moves it to the sysfs.c file in order to encapsulate the code a bit more.
Signed-off-by Daniel Lezcano <[email protected]>
--- drivers/cpuidle/sysfs.c | 7 +++++++ include/linux/cpuidle.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/cpuidle/sysfs.c +7 -0
@@ -297,6 +297,13 @@ static struct attribute *cpuidle_state_default_attrs[] = { NULL }; +struct cpuidle_state_kobj { +struct cpuidle_state *state; +struct cpuidle_state_usage *state_usage; +struct completion kobj_unregister; +struct kobject kobj; +}; +#define kobj_to_state_obj (k) container_of(k, struct cpuidle_state_kobj, kobj)#define kobj_to_state (k) (kobj_to_state_obj(k)->state)#define kobj_to_state_usage (k) (kobj_to_state_obj(k)->state_usage)
include/linux/cpuidle.h +0 -7
@@ -82,13 +82,6 @@ cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) st_usage->driver_data = data; } -struct cpuidle_state_kobj { -struct cpuidle_state *state; -struct cpuidle_state_usage *state_usage; -struct completion kobj_unregister; -struct kobject kobj; -}; -struct cpuidle_device {unsigned int registered:1 ;unsigned int enabled:1 ;
Signature · 1 line
1.7.5.4
Rafael J. Wysocki
AppliedQuoted 6 lines · Daniel Lezcano
The structure
cpuidle_state_kobjis not used anywhere except in thesysfs.cfile. The definition of this structure is not needed in the cpuidle header file. This patch moves it to thesysfs.cfile in order to encapsulate the code a bit more.Signed-off-by Daniel Lezcano <[email protected]>
Applied to the linux-next branch of linux-pm.git as v3.8 material.
Thanks,
Rafael
Quoted 41 lines
--- drivers/cpuidle/sysfs.c | 7 +++++++ include/linux/cpuidle.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)drivers/cpuidle/sysfs.c +7
-0@@ -297,6 +297,13 @@ static struct attribute *cpuidle_state_default_attrs[] = { NULL }; +struct cpuidle_state_kobj { +struct cpuidle_state *state; +struct cpuidle_state_usage *state_usage; +struct completion kobj_unregister; +struct kobject kobj; +}; +#define kobj_to_state_obj (k) container_of(k, struct cpuidle_state_kobj, kobj)#define kobj_to_state (k) (kobj_to_state_obj(k)->state)#define kobj_to_state_usage (k) (kobj_to_state_obj(k)->state_usage)include/linux/cpuidle.h +0
-7@@ -82,13 +82,6 @@ cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) st_usage->driver_data = data; } -struct cpuidle_state_kobj { -struct cpuidle_state *state; -struct cpuidle_state_usage *state_usage; -struct completion kobj_unregister; -struct kobject kobj; -}; -struct cpuidle_device {unsigned int registered:1 ;unsigned int enabled:1 ;
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.