[PATCH v3 8/8] sensord: Break long lines in doChips()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux