All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH v3 8/8] sensord: Break long lines in doChips()
@ 2009-11-03 20:04 Andre Prendel
  0 siblings, 0 replies; only message in thread
From: Andre Prendel @ 2009-11-03 20:04 UTC (permalink / raw)
  To: lm-sensors

This patch breaks long lines in function doChips().

Changes in v3:

* Use return to leave the loop.
---
 prog/sensord/sense.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: sensors/prog/sensord/sense.c
=================================--- sensors.orig/prog/sensord/sense.c	2009-10-31 20:53:26.000000000 +0100
+++ sensors/prog/sensord/sense.c	2009-10-31 21:03:47.000000000 +0100
@@ -219,17 +219,18 @@
 
 static int doChips(int action)
 {
-	const sensors_chip_name *chip;
+	const sensors_chip_name *chip, *chip_arg;
 	int i, j, ret = 0;
 
-	for (j = 0; (ret = 0) && (j < sensord_args.numChipNames); ++ j) {
+	for (j = 0; j < sensord_args.numChipNames; j++) {
+		chip_arg = &sensord_args.chipNames[j];
 		i = 0;
-		while ((ret = 0) &&
-		       ((chip = sensors_get_detected_chips(&sensord_args.chipNames[j], &i)) != NULL)) {
+		while ((chip = sensors_get_detected_chips(chip_arg, &i))) {
 			ret = doChip(chip, action);
+			if (ret)
+				return ret;
 		}
 	}
-
 	return ret;
 }
 

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-03 20:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 20:04 [lm-sensors] [PATCH v3 8/8] sensord: Break long lines in doChips() Andre Prendel

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.