All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [patch 26/36] hwmon: (w83795) Drop REST_VLT_BEGIN/END
Date: Wed, 15 Sep 2010 14:01:19 +0000	[thread overview]
Message-ID: <20100915160119.67bc8f4e@hyperion.delvare> (raw)

Get rid of REST_VLT_BEGIN and REST_VLT_END, they don't make the code
more readable.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/hwmon/w83795.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- linux-2.6.36-rc4.orig/drivers/hwmon/w83795.c	2010-09-15 15:14:03.000000000 +0200
+++ linux-2.6.36-rc4/drivers/hwmon/w83795.c	2010-09-15 15:14:05.000000000 +0200
@@ -175,10 +175,6 @@ static const u8 IN_LSB_SHIFT_IDX[][2]  };
 
 
-/* 3VDD, 3VSB, VBAT * 0.006 */
-#define REST_VLT_BEGIN			12  /* the 13th volt to 15th */
-#define REST_VLT_END			14  /* the 13th volt to 15th */
-
 #define W83795_REG_FAN(index)		(0x2E + (index))
 #define W83795_REG_FAN_MIN_HL(index)	(0xB6 + (index))
 #define W83795_REG_FAN_MIN_LSB(index)	(0xC4 + (index) / 2)
@@ -250,7 +246,8 @@ static const u8 IN_LSB_SHIFT_IDX[][2]  
 static inline u16 in_from_reg(u8 index, u16 val)
 {
-	if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END))
+	/* 3VDD, 3VSB and VBAT: 6 mV/bit; other inputs: 2 mV/bit */
+	if (index >= 12 && index <= 14)
 		return val * 6;
 	else
 		return val * 2;
@@ -258,7 +255,7 @@ static inline u16 in_from_reg(u8 index,
 
 static inline u16 in_to_reg(u8 index, u16 val)
 {
-	if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END))
+	if (index >= 12 && index <= 14)
 		return val / 6;
 	else
 		return val / 2;


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

                 reply	other threads:[~2010-09-15 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100915160119.67bc8f4e@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.