summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Valentin <edubezval@gmail.com>2016-11-08 00:09:21 -0500
committerZhang Rui <rui.zhang@intel.com>2016-11-22 21:06:12 -0500
commiteb7be329bd93b7ab09f442ffe3862b014ab84477 (patch)
tree535a57bec81eea02c719585edf7587cba71f8d4d
parent5027ba36cda6924488b5752820503cdf7a79dbe9 (diff)
thermal: core: standardize line breaking alignment
Pass through the code to remove check suggested by checkpatch.pl (alignment to parenthesis): CHECK: Alignment should match open parenthesis Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r--drivers/thermal/thermal_core.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index f19fe03e919f..d33b29a1553f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -137,10 +137,15 @@ int thermal_register_governor(struct thermal_governor *governor)
137 137
138 err = -EBUSY; 138 err = -EBUSY;
139 if (!__find_governor(governor->name)) { 139 if (!__find_governor(governor->name)) {
140 bool match_default;
141
140 err = 0; 142 err = 0;
141 list_add(&governor->governor_list, &thermal_governor_list); 143 list_add(&governor->governor_list, &thermal_governor_list);
142 if (!def_governor && !strncmp(governor->name, 144 match_default = !strncmp(governor->name,
143 DEFAULT_THERMAL_GOVERNOR, THERMAL_NAME_LENGTH)) 145 DEFAULT_THERMAL_GOVERNOR,
146 THERMAL_NAME_LENGTH);
147
148 if (!def_governor && match_default)
144 def_governor = governor; 149 def_governor = governor;
145 } 150 }
146 151
@@ -189,7 +194,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
189 194
190 list_for_each_entry(pos, &thermal_tz_list, node) { 195 list_for_each_entry(pos, &thermal_tz_list, node) {
191 if (!strncasecmp(pos->governor->name, governor->name, 196 if (!strncasecmp(pos->governor->name, governor->name,
192 THERMAL_NAME_LENGTH)) 197 THERMAL_NAME_LENGTH))
193 thermal_set_governor(pos, NULL); 198 thermal_set_governor(pos, NULL);
194 } 199 }
195 200
@@ -312,14 +317,15 @@ static void monitor_thermal_zone(struct thermal_zone_device *tz)
312} 317}
313 318
314static void handle_non_critical_trips(struct thermal_zone_device *tz, 319static void handle_non_critical_trips(struct thermal_zone_device *tz,
315 int trip, enum thermal_trip_type trip_type) 320 int trip,
321 enum thermal_trip_type trip_type)
316{ 322{
317 tz->governor ? tz->governor->throttle(tz, trip) : 323 tz->governor ? tz->governor->throttle(tz, trip) :
318 def_governor->throttle(tz, trip); 324 def_governor->throttle(tz, trip);
319} 325}
320 326
321static void handle_critical_trips(struct thermal_zone_device *tz, 327static void handle_critical_trips(struct thermal_zone_device *tz,
322 int trip, enum thermal_trip_type trip_type) 328 int trip, enum thermal_trip_type trip_type)
323{ 329{
324 int trip_temp; 330 int trip_temp;
325 331
@@ -797,7 +803,7 @@ static void thermal_release(struct device *dev)
797 tz = to_thermal_zone(dev); 803 tz = to_thermal_zone(dev);
798 kfree(tz); 804 kfree(tz);
799 } else if(!strncmp(dev_name(dev), "cooling_device", 805 } else if(!strncmp(dev_name(dev), "cooling_device",
800 sizeof("cooling_device") - 1)){ 806 sizeof("cooling_device") - 1)) {
801 cdev = to_cooling_device(dev); 807 cdev = to_cooling_device(dev);
802 kfree(cdev); 808 kfree(cdev);
803 } 809 }
@@ -1131,11 +1137,11 @@ exit:
1131 * in case of error, an ERR_PTR. Caller must check return value with 1137 * in case of error, an ERR_PTR. Caller must check return value with
1132 * IS_ERR*() helpers. 1138 * IS_ERR*() helpers.
1133 */ 1139 */
1134struct thermal_zone_device *thermal_zone_device_register(const char *type, 1140struct thermal_zone_device *
1135 int trips, int mask, void *devdata, 1141thermal_zone_device_register(const char *type, int trips, int mask,
1136 struct thermal_zone_device_ops *ops, 1142 void *devdata, struct thermal_zone_device_ops *ops,
1137 struct thermal_zone_params *tzp, 1143 struct thermal_zone_params *tzp, int passive_delay,
1138 int passive_delay, int polling_delay) 1144 int polling_delay)
1139{ 1145{
1140 struct thermal_zone_device *tz; 1146 struct thermal_zone_device *tz;
1141 enum thermal_trip_type trip_type; 1147 enum thermal_trip_type trip_type;
@@ -1400,7 +1406,7 @@ static struct genl_family thermal_event_genl_family = {
1400}; 1406};
1401 1407
1402int thermal_generate_netlink_event(struct thermal_zone_device *tz, 1408int thermal_generate_netlink_event(struct thermal_zone_device *tz,
1403 enum events event) 1409 enum events event)
1404{ 1410{
1405 struct sk_buff *skb; 1411 struct sk_buff *skb;
1406 struct nlattr *attr; 1412 struct nlattr *attr;
@@ -1477,7 +1483,7 @@ static inline void genetlink_exit(void) {}
1477#endif /* !CONFIG_NET */ 1483#endif /* !CONFIG_NET */
1478 1484
1479static int thermal_pm_notify(struct notifier_block *nb, 1485static int thermal_pm_notify(struct notifier_block *nb,
1480 unsigned long mode, void *_unused) 1486 unsigned long mode, void *_unused)
1481{ 1487{
1482 struct thermal_zone_device *tz; 1488 struct thermal_zone_device *tz;
1483 1489