Re: [PATCH v2 6/6] sensord: Break long lines in doChips()

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

 



On Mon, 26 Oct 2009 21:57:57 +0100, Andre Prendel wrote:
> This patch breaks long lines in function doChips().
> ---
> 
>  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-26 21:32:05.000000000 +0100
> +++ sensors/prog/sensord/sense.c	2009-10-26 21:32:23.000000000 +0100
> @@ -209,17 +209,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)
> +				break;

This breaks out of the while loop but not the outermost for loop. This
is a slight change from the original code... on purpose or not? if not,
then a direct return might be better suited.

>  		}
>  	}
> -
>  	return ret;
>  }
>  


-- 
Jean Delvare

_______________________________________________
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