diff options
author | Paul Fertser <fercerpav@gmail.com> | 2021-09-24 21:52:02 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2021-10-12 16:22:41 +0200 |
commit | 952a11ca32a6046ab86bf885a7805c935f71d5c8 (patch) | |
tree | 1bb2b287dc4ec029e6a5587bfe62bd3d6e413d7e /drivers/hwmon/lm63.c | |
parent | hwmon: (tmp103) Convert tmp103 to use new hwmon registration API (diff) | |
download | linux-952a11ca32a6046ab86bf885a7805c935f71d5c8.tar.xz linux-952a11ca32a6046ab86bf885a7805c935f71d5c8.zip |
hwmon: cleanup non-bool "valid" data fields
We have bool so use it consistently in all the drivers.
The following Coccinelle script was used:
@@
identifier T;
type t = { char, int };
@@
struct T {
...
- t valid;
+ bool valid;
...
}
@@
identifier v;
@@
(
- v->valid = 0
+ v->valid = false
|
- v->valid = 1
+ v->valid = true
)
followed by sed to fixup the comments:
sed '/bool valid;/{s/!=0/true/;s/zero/false/}'
Few whitespace changes were fixed manually. All modified drivers were
compile-tested.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com
[groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/lm63.c')
-rw-r--r-- | drivers/hwmon/lm63.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index c8f93c5d1ccc..339a145afc09 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c @@ -139,7 +139,7 @@ struct lm63_data { struct i2c_client *client; struct mutex update_lock; const struct attribute_group *groups[5]; - char valid; /* zero until following fields are valid */ + bool valid; /* false until following fields are valid */ char lut_valid; /* zero until lut fields are valid */ unsigned long last_updated; /* in jiffies */ unsigned long lut_last_updated; /* in jiffies */ @@ -289,7 +289,7 @@ static struct lm63_data *lm63_update_device(struct device *dev) LM63_REG_ALERT_STATUS) & 0x7F; data->last_updated = jiffies; - data->valid = 1; + data->valid = true; } lm63_update_lut(data); @@ -714,7 +714,7 @@ static ssize_t temp2_type_store(struct device *dev, 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)); - data->valid = 0; + data->valid = false; mutex_unlock(&data->update_lock); return count; |