From: Clemens Ladisch <clemens@ladisch.de>
To: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Jean Delvare <khali@linux-fr.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>
Subject: Re: [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers
Date: Wed, 16 Feb 2011 16:11:35 +0100 [thread overview]
Message-ID: <4D5BE927.7000306@ladisch.de> (raw)
In-Reply-To: <20110216145049.GC13872@ericsson.com>
Guenter Roeck wrote:
> On Wed, Feb 16, 2011 at 08:02:38AM -0500, Clemens Ladisch wrote:
> > + readonly = config & JC42_CFG_TCRIT_LOCK;
>
> You are assigning a non-bool to a bool. I can see that recent C compilers
> do the right thing, but I am not sure if that is always the case.
> So I would prefer
> readonly = !!(config & JC42_CFG_TCRIT_LOCK));
>
> Same for the assignments below. I can make that change if you are ok with it.
I cannot imagine how a compiler could get this wrong even if it tried
to, but if you think so, go ahead. :)
Regards,
Clemens
WARNING: multiple messages have this Message-ID (diff)
From: Clemens Ladisch <clemens@ladisch.de>
To: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Jean Delvare <khali@linux-fr.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>
Subject: Re: [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to
Date: Wed, 16 Feb 2011 15:11:35 +0000 [thread overview]
Message-ID: <4D5BE927.7000306@ladisch.de> (raw)
In-Reply-To: <20110216145049.GC13872@ericsson.com>
Guenter Roeck wrote:
> On Wed, Feb 16, 2011 at 08:02:38AM -0500, Clemens Ladisch wrote:
> > + readonly = config & JC42_CFG_TCRIT_LOCK;
>
> You are assigning a non-bool to a bool. I can see that recent C compilers
> do the right thing, but I am not sure if that is always the case.
> So I would prefer
> readonly = !!(config & JC42_CFG_TCRIT_LOCK));
>
> Same for the assignments below. I can make that change if you are ok with it.
I cannot imagine how a compiler could get this wrong even if it tried
to, but if you think so, go ahead. :)
Regards,
Clemens
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2011-02-16 15:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 13:00 [PATCH 0/3] hwmon: some jc42 changes Clemens Ladisch
2011-02-16 13:00 ` [lm-sensors] " Clemens Ladisch
2011-02-16 13:01 ` [PATCH 1/3] hwmon: (jc42) fix type mismatch Clemens Ladisch
2011-02-16 13:01 ` [lm-sensors] " Clemens Ladisch
2011-02-16 15:09 ` Guenter Roeck
2011-02-16 15:09 ` Guenter Roeck
2011-02-16 13:02 ` [PATCH 2/3] hwmon: (jc42) more helpful documentation Clemens Ladisch
2011-02-16 13:02 ` [lm-sensors] " Clemens Ladisch
2011-02-16 15:09 ` Guenter Roeck
2011-02-16 15:09 ` [lm-sensors] [PATCH 2/3] hwmon: (jc42) more helpful Guenter Roeck
2011-02-16 13:02 ` [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers Clemens Ladisch
2011-02-16 13:02 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to Clemens Ladisch
2011-02-16 14:50 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers Guenter Roeck
2011-02-16 14:50 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to Guenter Roeck
2011-02-16 15:11 ` Clemens Ladisch [this message]
2011-02-16 15:11 ` Clemens Ladisch
2011-02-16 15:20 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers Guenter Roeck
2011-02-16 15:20 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to Guenter Roeck
2011-02-16 15:38 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers Clemens Ladisch
2011-02-16 15:38 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to Clemens Ladisch
2011-02-16 16:15 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to locked registers Guenter Roeck
2011-02-16 16:15 ` [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to Guenter Roeck
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=4D5BE927.7000306@ladisch.de \
--to=clemens@ladisch.de \
--cc=guenter.roeck@ericsson.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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.