Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434581 > unrolled thread

[PATCH 5/6] hwmon: (lm90) Use bool for valid flag

Started byGuenter Roeck <linux@roeck-us.net>
First post2016-06-30 16:00 +0200
Last post2016-06-30 16:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/6] hwmon: (lm90) Use bool for valid flag Guenter Roeck <linux@roeck-us.net> - 2016-06-30 16:00 +0200

#1434581 — [PATCH 5/6] hwmon: (lm90) Use bool for valid flag

FromGuenter Roeck <linux@roeck-us.net>
Date2016-06-30 16:00 +0200
Subject[PATCH 5/6] hwmon: (lm90) Use bool for valid flag
Message-ID<rPKFB-1Pr-53@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web