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/it87.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/it87.c')
-rw-r--r-- | drivers/hwmon/it87.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 1f93134afcb9..0e543dbe0a6b 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -519,7 +519,7 @@ struct it87_data { unsigned short addr; const char *name; struct mutex update_lock; - char valid; /* !=0 if following fields are valid */ + bool valid; /* true if following fields are valid */ unsigned long last_updated; /* In jiffies */ u16 in_scaled; /* Internal voltage sensors are scaled */ @@ -844,7 +844,7 @@ static struct it87_data *it87_update_device(struct device *dev) data->vid &= 0x3f; } data->last_updated = jiffies; - data->valid = 1; + data->valid = true; } mutex_unlock(&data->update_lock); @@ -980,7 +980,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *attr, regval |= 0x80; it87_write_value(data, IT87_REG_BEEP_ENABLE, regval); } - data->valid = 0; + data->valid = false; reg = IT87_REG_TEMP_OFFSET[nr]; break; } @@ -1079,7 +1079,7 @@ static ssize_t set_temp_type(struct device *dev, struct device_attribute *attr, it87_write_value(data, IT87_REG_TEMP_ENABLE, data->sensor); if (has_temp_old_peci(data, nr)) it87_write_value(data, IT87_REG_TEMP_EXTRA, data->extra); - data->valid = 0; /* Force cache refresh */ + data->valid = false; /* Force cache refresh */ mutex_unlock(&data->update_lock); return count; } @@ -1834,7 +1834,7 @@ static ssize_t clear_intrusion(struct device *dev, config |= BIT(5); it87_write_value(data, IT87_REG_CONFIG, config); /* Invalidate cache to force re-read */ - data->valid = 0; + data->valid = false; } mutex_unlock(&data->update_lock); @@ -3229,7 +3229,7 @@ static int __maybe_unused it87_resume(struct device *dev) it87_start_monitoring(data); /* force update */ - data->valid = 0; + data->valid = false; mutex_unlock(&data->update_lock); |