From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] PATCH: hwmon-abituguru-volt-test.patch
Date: Mon, 18 Jun 2007 12:05:19 +0000 [thread overview]
Message-ID: <20070618140519.5a3e2cf6@hyperion.delvare> (raw)
In-Reply-To: <46759456.9080905@hhs.nl>
Hi Hans,
On Sun, 17 Jun 2007 22:06:46 +0200, Hans de Goede wrote:
> This patch fixes the detection of volt inputs with a reading of more then 240
> units.
> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
> diff -urN linux-2.6.22-rc4.orig/drivers/hwmon/abituguru.c linux-2.6.22-rc4/drivers/hwmon/abituguru.c
> --- linux-2.6.22-rc4.orig/drivers/hwmon/abituguru.c 2007-06-17 09:10:17.000000000 +0200
> +++ linux-2.6.22-rc4/drivers/hwmon/abituguru.c 2007-06-17 09:09:48.000000000 +0200
> (...)
> @@ -449,10 +449,23 @@
>
> ABIT_UGURU_DEBUG(2, "testing bank1 sensor %d\n", (int)sensor_addr);
> /* Volt sensor test, enable volt low alarm, set min value ridicously
> - high. If its a volt sensor this should always give us an alarm. */
> - buf[0] = ABIT_UGURU_VOLT_LOW_ALARM_ENABLE;
> - buf[1] = 245;
> - buf[2] = 250;
> + high, or vica versa if the reading is very high. If its a volt
> + sensor this should always give us an alarm. */
> + if (val <= 240u)
> + {
> + buf[0] = ABIT_UGURU_VOLT_LOW_ALARM_ENABLE;
> + buf[1] = 245;
> + buf[2] = 250;
> + test_flag = ABIT_UGURU_VOLT_LOW_ALARM_FLAG;
> + }
> + else
> + {
> + buf[0] = ABIT_UGURU_VOLT_HIGH_ALARM_ENABLE;
> + buf[1] = 5;
> + buf[2] = 10;
> + test_flag = ABIT_UGURU_VOLT_HIGH_ALARM_FLAG;
> + }
> +
> if (abituguru_write(data, ABIT_UGURU_SENSOR_BANK1 + 2, sensor_addr,
> buf, 3) != 3)
> goto abituguru_detect_bank1_sensor_type_exit;
Curly braces placement infringes Documentation/CodingSyle.
Other than that, patch looks good.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-06-18 12:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-17 19:56 [lm-sensors] PATCH: hwmon-abituguru-volt-test.patch Hans de Goede
2007-06-18 12:05 ` Jean Delvare [this message]
2007-06-18 20:59 ` Hans de Goede
2007-06-24 13:54 ` Mark M. Hoffman
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=20070618140519.5a3e2cf6@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.