diff for duplicates of <548856AF.8090805@roeck-us.net> diff --git a/a/1.txt b/N1/1.txt index 7984a25..a3d60e9 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -61,7 +61,7 @@ While nice, this is an unrelated change. > val = (s16)data->regs[reg]; > break; > + case INA2XX_CALIBRATION: -> + if (data->regs[reg] = 0) +> + if (data->regs[reg] == 0) > + val = 0; > + else > + val = data->config->calibration_factor @@ -93,20 +93,14 @@ I think it would be better to write a separate show function to display it. > + if (status < 0) > + return status; > + -> + if (val = 0 || +> + if (val == 0 || > + /* Values greater than the calibration factor make no sense. */ > + val > data->config->calibration_factor || > + val > LONG_MAX) data->config->calibration_factor is <= LONG_MAX, so the second check is unnecessary. Actually, given that calibration_factor is chip dependent and not necessarily known -by the user, it would make more sense to only bail out on = 0 and then use clamp_val +by the user, it would make more sense to only bail out on == 0 and then use clamp_val to limit the range to (1, data->config->calibration_factor). Guenter - - -_______________________________________________ -lm-sensors mailing list -lm-sensors@lm-sensors.org -http://lists.lm-sensors.org/mailman/listinfo/lm-sensors diff --git a/a/content_digest b/N1/content_digest index 35b1daa..b0a8df6 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,8 +1,8 @@ "ref\01418207937-11648-1-git-send-email-bgolaszewski@baylibre.com\0" "ref\01418207937-11648-2-git-send-email-bgolaszewski@baylibre.com\0" "From\0Guenter Roeck <linux@roeck-us.net>\0" - "Subject\0Re: [lm-sensors] [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time\0" - "Date\0Wed, 10 Dec 2014 14:20:31 +0000\0" + "Subject\0Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time\0" + "Date\0Wed, 10 Dec 2014 06:20:31 -0800\0" "To\0Bartosz Golaszewski <bgolaszewski@baylibre.com>\0" "Cc\0LKML <linux-kernel@vger.kernel.org>" Benoit Cousson <bcousson@baylibre.com> @@ -73,7 +73,7 @@ "> \t\tval = (s16)data->regs[reg];\n" "> \t\tbreak;\n" "> +\tcase INA2XX_CALIBRATION:\n" - "> +\t\tif (data->regs[reg] = 0)\n" + "> +\t\tif (data->regs[reg] == 0)\n" "> +\t\t\tval = 0;\n" "> +\t\telse\n" "> +\t\t\tval = data->config->calibration_factor\n" @@ -105,22 +105,16 @@ "> +\tif (status < 0)\n" "> +\t\treturn status;\n" "> +\n" - "> +\tif (val = 0 ||\n" + "> +\tif (val == 0 ||\n" "> +\t /* Values greater than the calibration factor make no sense. */\n" "> +\t val > data->config->calibration_factor ||\n" "> +\t val > LONG_MAX)\n" "\n" "data->config->calibration_factor is <= LONG_MAX, so the second check is unnecessary.\n" "Actually, given that calibration_factor is chip dependent and not necessarily known\n" - "by the user, it would make more sense to only bail out on = 0 and then use clamp_val\n" + "by the user, it would make more sense to only bail out on == 0 and then use clamp_val\n" "to limit the range to (1, data->config->calibration_factor).\n" "\n" - "Guenter\n" - "\n" - "\n" - "_______________________________________________\n" - "lm-sensors mailing list\n" - "lm-sensors@lm-sensors.org\n" - http://lists.lm-sensors.org/mailman/listinfo/lm-sensors + Guenter -4e53eff4f9c12359f1d464dd22cc001af27a9c98616a94183a7177d9e5177525 +719e6bf1b9299a2436f023c2de5d7f2aca7e9a0bbd39902ee6b159b717b7b245
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.