All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nate Case <ncase@xes-inc.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 2/2] hwmon: (lm90) Support ADT7461 in
Date: Mon, 16 Jun 2008 16:50:04 +0000	[thread overview]
Message-ID: <1213635004.7559.327.camel@localhost.localdomain> (raw)
In-Reply-To: <1213374973-3262-3-git-send-email-ncase@xes-inc.com>

On Sun, 2008-06-15 at 14:18 +0200, Jean Delvare wrote:
> Values above 63 degrees C are also broken due to the cast to s8. You
> wrote yourself above that the ADT7461 treats the values as unsigned,
> so
> this conversion function should really return a u8 not s8. The cast
> from u8 to s8 and back should happen only when you write the value to
> struct lm90_data and read it back from the structure, respectively
> (and
> I guess this will be done implicitly so you may not even have to
> care.)
> I agree that you end up writing the same value to the chip register,
> but it's convenient to also be able to use the value inside the driver
> (for debugging purposes if nothing else) so it should be correct all
> along the way.

Point taken -- "broken" sounds a bit harsh since it does actually work
at those temperatures as s8/s16 :)  The driver didn't appear to use the
values in any way that would have resulted in unexpected behavior
(though I suppose this could change and could also confuse during debug
like you mention).  I'll change those to unsigned.

Quick question before I address all of your feedback with patch v2: You
didn't mention these specifically, but I'm assuming you'd also want the
tempX_from_reg_adt7461() functions to use u8 and u16 as well?

Thanks for the feedback.

-- 
Nate Case <ncase@xes-inc.com>


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

  parent reply	other threads:[~2008-06-16 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 16:36 [lm-sensors] [PATCH 2/2] hwmon: (lm90) Support ADT7461 in extended Nate Case
2008-06-15 12:18 ` [lm-sensors] [PATCH 2/2] hwmon: (lm90) Support ADT7461 in Jean Delvare
2008-06-16 16:50 ` Nate Case [this message]
2008-06-16 17:17 ` Jean Delvare

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=1213635004.7559.327.camel@localhost.localdomain \
    --to=ncase@xes-inc.com \
    --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.