All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v2 2/2] hwmon: (lm63) Add sensor type attribute for external sensor on LM961
Date: Fri, 13 Jan 2012 11:40:32 +0000	[thread overview]
Message-ID: <20120113114032.GA22249@ericsson.com> (raw)
In-Reply-To: <1326407015-7181-2-git-send-email-linux@roeck-us.net>

On Fri, Jan 13, 2012 at 03:47:10AM -0500, Jean Delvare wrote:
> On Thu, 12 Jan 2012 14:23:35 -0800, Guenter Roeck wrote:
> > On LM96163, the external temperature sensor type is configurable to
> > either a thermal diode or a 3904 transistor. The chip reports a wrong
> > temperature if misconfigured. Add writable attribute to support it.
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> > v2:
> > - snprintf -> sprintf
> > - set temp sensor type to 1(CPU diode) instead of 3 (thermal diode) if trutherm
> >   is enabled
> > - return error code from kstrtoul()
> > - When configuring the diode type, only set trutherm enable bit
> > - When detecting configured diode type, only check trutherm enable bit
> > - Document that configuring the thermal sensor type is supported for LM96163
> 
> I don't see such documentation addition. Forgot to add the file to the
> patch?
> 
That I did.

> >  drivers/hwmon/lm63.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 50 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
> > (...)
> > +	reg = i2c_smbus_read_byte_data(client, LM96163_REG_TRUTHERM) & ~0x02;
> > +	i2c_smbus_write_byte_data(client, LM96163_REG_TRUTHERM,
> > +				  reg | data->trutherm ? 0x02 : 0x00);
> 
> This lacks parentheses to do the right thing. | has higher precedence
> than ?:. It works by chance because reg has value 0 in practice.
> 
Sigh. You'll get another one in a minute.

Guenter

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

      parent reply	other threads:[~2012-01-13 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 22:23 [lm-sensors] [PATCH v2 2/2] hwmon: (lm63) Add sensor type attribute for external sensor on LM96163 Guenter Roeck
2012-01-13  8:47 ` [lm-sensors] [PATCH v2 2/2] hwmon: (lm63) Add sensor type attribute for external sensor on LM961 Jean Delvare
2012-01-13 11:40 ` Guenter Roeck [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=20120113114032.GA22249@ericsson.com \
    --to=guenter.roeck@ericsson.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.