All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] therm_throt.c: Fix error handling in
@ 2010-09-03  0:45 ` Fenghua Yu
  0 siblings, 0 replies; 12+ messages in thread
From: Fenghua Yu @ 2010-09-03  0:45 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H Peter Anvin, Len Brown,
	Jin Dongming, Hidetoshi Seto, Jean Delvare
  Cc: linux-kernel, lm-sensors, Fenghua Yu

From: Fenghua Yu <fenghua.yu@intel.com>

Warn when sysfs_add_file_to_group fails.

Also add missing curly braces.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 arch/x86/kernel/cpu/mcheck/therm_throt.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index c2a8b26..4c3cd62 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -211,20 +211,26 @@ static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev)
 	if (err)
 		return err;
 
-	if (cpu_has(c, X86_FEATURE_PLN))
+	if (cpu_has(c, X86_FEATURE_PLN)) {
 		err = sysfs_add_file_to_group(&sys_dev->kobj,
 					      &attr_core_power_limit_count.attr,
 					      thermal_attr_group.name);
-	if (cpu_has(c, X86_FEATURE_PTS))
+		WARN_ON(err);
+	}
+	if (cpu_has(c, X86_FEATURE_PTS)) {
 		err = sysfs_add_file_to_group(&sys_dev->kobj,
 					      &attr_package_throttle_count.attr,
 					      thermal_attr_group.name);
-		if (cpu_has(c, X86_FEATURE_PLN))
+		WARN_ON(err);
+		if (cpu_has(c, X86_FEATURE_PLN)) {
 			err = sysfs_add_file_to_group(&sys_dev->kobj,
 					&attr_package_power_limit_count.attr,
 					thermal_attr_group.name);
+			WARN_ON(err);
+		}
+	}
 
-	return err;
+	return 0;
 }
 
 static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)
-- 
1.6.0.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-09-05 16:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03  0:45 [lm-sensors] [PATCH] therm_throt.c: Fix error handling in Fenghua Yu
2010-09-03  0:45 ` [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Fenghua Yu
2010-09-03  8:48 ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling in Jean Delvare
2010-09-03  8:48   ` [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Jean Delvare
2010-09-03  9:35 ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling in Ingo Molnar
2010-09-03  9:35   ` [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Ingo Molnar
2010-09-03 21:34   ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling Fenghua Yu
2010-09-03 21:34     ` [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Fenghua Yu
2010-09-05 12:32     ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling in Ingo Molnar
2010-09-05 12:32       ` [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Ingo Molnar
2010-09-05 16:35       ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling in Guenter Roeck
2010-09-05 16:35         ` [lm-sensors] [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.