aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/sysfs.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-06-12 09:08:50 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-14 20:09:47 -0400
commitf89ae89e2790341587f7132f0552c941342115e9 (patch)
tree09a097401f8198ab9cc90f52404b071be7b4e9f0 /drivers/cpuidle/sysfs.c
parent10b9d3f8a4d5c82bff5b232a0063669dc0e0d725 (diff)
cpuidle: Fix white space to follow CodingStyle
Fix white space in the cpuidle code to follow the rules described in CodingStyle. No changes in behavior should result from this. [rjw: Changelog] Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r--drivers/cpuidle/sysfs.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 428754af6236..7d4448a9fbbd 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -33,7 +33,8 @@ static ssize_t show_available_governors(struct device *dev,
33 33
34 mutex_lock(&cpuidle_lock); 34 mutex_lock(&cpuidle_lock);
35 list_for_each_entry(tmp, &cpuidle_governors, governor_list) { 35 list_for_each_entry(tmp, &cpuidle_governors, governor_list) {
36 if (i >= (ssize_t) ((PAGE_SIZE/sizeof(char)) - CPUIDLE_NAME_LEN - 2)) 36 if (i >= (ssize_t) ((PAGE_SIZE/sizeof(char)) -
37 CPUIDLE_NAME_LEN - 2))
37 goto out; 38 goto out;
38 i += scnprintf(&buf[i], CPUIDLE_NAME_LEN, "%s ", tmp->name); 39 i += scnprintf(&buf[i], CPUIDLE_NAME_LEN, "%s ", tmp->name);
39 } 40 }
@@ -168,11 +169,13 @@ struct cpuidle_attr {
168 169
169#define kobj_to_cpuidledev(k) container_of(k, struct cpuidle_device, kobj) 170#define kobj_to_cpuidledev(k) container_of(k, struct cpuidle_device, kobj)
170#define attr_to_cpuidleattr(a) container_of(a, struct cpuidle_attr, attr) 171#define attr_to_cpuidleattr(a) container_of(a, struct cpuidle_attr, attr)
171static ssize_t cpuidle_show(struct kobject * kobj, struct attribute * attr ,char * buf) 172
173static ssize_t cpuidle_show(struct kobject *kobj, struct attribute *attr,
174 char *buf)
172{ 175{
173 int ret = -EIO; 176 int ret = -EIO;
174 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj); 177 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj);
175 struct cpuidle_attr * cattr = attr_to_cpuidleattr(attr); 178 struct cpuidle_attr *cattr = attr_to_cpuidleattr(attr);
176 179
177 if (cattr->show) { 180 if (cattr->show) {
178 mutex_lock(&cpuidle_lock); 181 mutex_lock(&cpuidle_lock);
@@ -182,12 +185,12 @@ static ssize_t cpuidle_show(struct kobject * kobj, struct attribute * attr ,char
182 return ret; 185 return ret;
183} 186}
184 187
185static ssize_t cpuidle_store(struct kobject * kobj, struct attribute * attr, 188static ssize_t cpuidle_store(struct kobject *kobj, struct attribute *attr,
186 const char * buf, size_t count) 189 const char *buf, size_t count)
187{ 190{
188 int ret = -EIO; 191 int ret = -EIO;
189 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj); 192 struct cpuidle_device *dev = kobj_to_cpuidledev(kobj);
190 struct cpuidle_attr * cattr = attr_to_cpuidleattr(attr); 193 struct cpuidle_attr *cattr = attr_to_cpuidleattr(attr);
191 194
192 if (cattr->store) { 195 if (cattr->store) {
193 mutex_lock(&cpuidle_lock); 196 mutex_lock(&cpuidle_lock);
@@ -237,8 +240,8 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
237 240
238#define define_store_state_ull_function(_name) \ 241#define define_store_state_ull_function(_name) \
239static ssize_t store_state_##_name(struct cpuidle_state *state, \ 242static ssize_t store_state_##_name(struct cpuidle_state *state, \
240 struct cpuidle_state_usage *state_usage, \ 243 struct cpuidle_state_usage *state_usage, \
241 const char *buf, size_t size) \ 244 const char *buf, size_t size) \
242{ \ 245{ \
243 unsigned long long value; \ 246 unsigned long long value; \
244 int err; \ 247 int err; \
@@ -256,14 +259,16 @@ static ssize_t store_state_##_name(struct cpuidle_state *state, \
256 259
257#define define_show_state_ull_function(_name) \ 260#define define_show_state_ull_function(_name) \
258static ssize_t show_state_##_name(struct cpuidle_state *state, \ 261static ssize_t show_state_##_name(struct cpuidle_state *state, \
259 struct cpuidle_state_usage *state_usage, char *buf) \ 262 struct cpuidle_state_usage *state_usage, \
263 char *buf) \
260{ \ 264{ \
261 return sprintf(buf, "%llu\n", state_usage->_name);\ 265 return sprintf(buf, "%llu\n", state_usage->_name);\
262} 266}
263 267
264#define define_show_state_str_function(_name) \ 268#define define_show_state_str_function(_name) \
265static ssize_t show_state_##_name(struct cpuidle_state *state, \ 269static ssize_t show_state_##_name(struct cpuidle_state *state, \
266 struct cpuidle_state_usage *state_usage, char *buf) \ 270 struct cpuidle_state_usage *state_usage, \
271 char *buf) \
267{ \ 272{ \
268 if (state->_name[0] == '\0')\ 273 if (state->_name[0] == '\0')\
269 return sprintf(buf, "<null>\n");\ 274 return sprintf(buf, "<null>\n");\
@@ -309,8 +314,9 @@ struct cpuidle_state_kobj {
309#define kobj_to_state(k) (kobj_to_state_obj(k)->state) 314#define kobj_to_state(k) (kobj_to_state_obj(k)->state)
310#define kobj_to_state_usage(k) (kobj_to_state_obj(k)->state_usage) 315#define kobj_to_state_usage(k) (kobj_to_state_obj(k)->state_usage)
311#define attr_to_stateattr(a) container_of(a, struct cpuidle_state_attr, attr) 316#define attr_to_stateattr(a) container_of(a, struct cpuidle_state_attr, attr)
312static ssize_t cpuidle_state_show(struct kobject * kobj, 317
313 struct attribute * attr ,char * buf) 318static ssize_t cpuidle_state_show(struct kobject *kobj, struct attribute *attr,
319 char * buf)
314{ 320{
315 int ret = -EIO; 321 int ret = -EIO;
316 struct cpuidle_state *state = kobj_to_state(kobj); 322 struct cpuidle_state *state = kobj_to_state(kobj);
@@ -323,8 +329,8 @@ static ssize_t cpuidle_state_show(struct kobject * kobj,
323 return ret; 329 return ret;
324} 330}
325 331
326static ssize_t cpuidle_state_store(struct kobject *kobj, 332static ssize_t cpuidle_state_store(struct kobject *kobj, struct attribute *attr,
327 struct attribute *attr, const char *buf, size_t size) 333 const char *buf, size_t size)
328{ 334{
329 int ret = -EIO; 335 int ret = -EIO;
330 struct cpuidle_state *state = kobj_to_state(kobj); 336 struct cpuidle_state *state = kobj_to_state(kobj);
@@ -449,8 +455,8 @@ static void cpuidle_driver_sysfs_release(struct kobject *kobj)
449 complete(&driver_kobj->kobj_unregister); 455 complete(&driver_kobj->kobj_unregister);
450} 456}
451 457
452static ssize_t cpuidle_driver_show(struct kobject *kobj, struct attribute * attr, 458static ssize_t cpuidle_driver_show(struct kobject *kobj, struct attribute *attr,
453 char * buf) 459 char *buf)
454{ 460{
455 int ret = -EIO; 461 int ret = -EIO;
456 struct cpuidle_driver_kobj *driver_kobj = kobj_to_driver_kobj(kobj); 462 struct cpuidle_driver_kobj *driver_kobj = kobj_to_driver_kobj(kobj);