From: Guenter Roeck <linux@roeck-us.net>
To: Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 5/6] hwmon: (lm90) Use bool for valid flag
Date: Thu, 30 Jun 2016 06:51:00 -0700 [thread overview]
Message-ID: <1467294661-23879-5-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1467294661-23879-1-git-send-email-linux@roeck-us.net>
Use bool for valid flag and leave it up to the compiler to find
an optimal representation.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/lm90.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 322a73d3d135..c38d6e4e95b5 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -367,7 +367,7 @@ struct lm90_data {
struct i2c_client *client;
const struct attribute_group *groups[6];
struct mutex update_lock;
- char valid; /* zero until following fields are valid */
+ bool valid; /* true if register values are valid */
unsigned long last_updated; /* in jiffies */
int kind;
u32 flags;
@@ -624,7 +624,7 @@ static struct lm90_data *lm90_update_device(struct device *dev)
if (time_after(jiffies, next_update) || !data->valid) {
dev_dbg(&client->dev, "Updating lm90 data.\n");
- data->valid = 0;
+ data->valid = false;
val = lm90_read_reg(client, LM90_REG_R_LOCAL_LOW);
if (val < 0)
@@ -697,7 +697,7 @@ static struct lm90_data *lm90_update_device(struct device *dev)
}
data->last_updated = jiffies;
- data->valid = 1;
+ data->valid = true;
}
error:
--
2.5.0
next prev parent reply other threads:[~2016-06-30 13:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 13:50 [PATCH 1/6] hwmon: (lm90) Use devm_add_action for cleanup Guenter Roeck
2016-06-30 13:50 ` [PATCH 2/6] hwmon: (lm90) Use devm_hwmon_device_register_with_groups Guenter Roeck
2016-06-30 13:50 ` [PATCH 3/6] hwmon: (lm90) Simplify read functions Guenter Roeck
2016-06-30 13:50 ` [PATCH 4/6] hwmon: (lm90) Read limit registers only once Guenter Roeck
2016-06-30 13:51 ` Guenter Roeck [this message]
2016-06-30 13:51 ` [PATCH 6/6] hwmon: (lm90) Drop unnecessary else statements 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=1467294661-23879-5-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox