From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (it87) Add chassis intrusion
Date: Thu, 28 Jul 2011 05:35:01 +0000 [thread overview]
Message-ID: <20110728053501.GA21551@ericsson.com> (raw)
In-Reply-To: <20110713212507.42269295@endymion.delvare>
On Sat, Jul 16, 2011 at 04:45:49PM -0400, Jean Delvare wrote:
> Hi Guenter,
>
> On Wed, 13 Jul 2011 14:01:01 -0700, Guenter Roeck wrote:
> > On Wed, 2011-07-13 at 15:25 -0400, Jean Delvare wrote:
> > > Add chassis intrusion detection support for all supported devices,
> > > using the standard interface.
> > >
> > > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > > ---
> > > This needs testing! The only report I have so far, says that reporting
> > > works OK but clearing the intrusion alarm does not. That case is still
> > > under investigation, as my code follows the datasheet as far as I can
> > > see, so I have no idea why it wouldn't work.
> > >
> > > it87.c | 29 +++++++++++++++++++++++++++++
> > > 1 file changed, 29 insertions(+)
> > >
> > > --- it87.orig/drivers/hwmon/it87.c 2011-07-11 16:09:21.000000000 +0200
> > > +++ it87/drivers/hwmon/it87.c 2011-07-13 21:10:53.000000000 +0200
> > > @@ -1172,6 +1172,32 @@ static ssize_t show_alarm(struct device
> > > struct it87_data *data = it87_update_device(dev);
> > > return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1);
> > > }
> > > +
> > > +static ssize_t clear_intrusion(struct device *dev, struct device_attribute
> > > + *attr, const char *buf, size_t count)
> > > +{
> > > + struct it87_data *data = dev_get_drvdata(dev);
> > > + long val;
> > > + int config;
> > > +
> > > + if (strict_strtol(buf, 10, &val) < 0 || val != 0)
> > > + return -EINVAL;
> > > +
> > > + mutex_lock(&data->update_lock);
> > > + config = it87_read_value(data, IT87_REG_CONFIG);
> > > + if (config < 0)
> > > + count = config;
> > > + else {
> > > + config |= 1 << 5;
> > > + it87_write_value(data, IT87_REG_CONFIG, config);
> > > + /* Invalidate cache to force re-read */
> > > + data->valid = 0;
> > > + }
> > If you use { } for the else branch, you should use { } for the if branch
> > as well.
>
> checkpatch.pl says that I can, not that I have to. But I will if that
> makes you happy...
>
Hi Jean,
mentioned in CodingStyle, really.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-07-28 5:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 19:25 [lm-sensors] [PATCH] hwmon: (it87) Add chassis intrusion detection Jean Delvare
2011-07-13 21:01 ` [lm-sensors] [PATCH] hwmon: (it87) Add chassis intrusion Guenter Roeck
2011-07-16 20:45 ` Jean Delvare
2011-07-28 5:35 ` 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=20110728053501.GA21551@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.