All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v2 6/6] sensord: Break long lines in
Date: Thu, 29 Oct 2009 08:18:23 +0000	[thread overview]
Message-ID: <20091029091823.6427867d@hyperion.delvare> (raw)
In-Reply-To: <20091026205757.GG4725@ubuntu>

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

      reply	other threads:[~2009-10-29  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 20:57 [lm-sensors] [PATCH v2 6/6] sensord: Break long lines in doChips() Andre Prendel
2009-10-29  8:18 ` Jean Delvare [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091029091823.6427867d@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.