* [PATCH] hwmon: asus-ec-sensors: remove braces from single-statement blocks
@ 2026-04-09 19:24 Josh Hesketh
2026-04-09 20:03 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Josh Hesketh @ 2026-04-09 19:24 UTC (permalink / raw)
To: eugene.shalygin, linux; +Cc: linux-hwmon, linux-kernel, Josh Hesketh
Remove unnecessary braces from single-statement if blocks
to follow kernel style guidelines
Signed-off-by: Josh Hesketh <josh.hesketh@gmail.com>
---
drivers/hwmon/asus-ec-sensors.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index adedaf0db10e..22a52c8f72a6 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -1027,9 +1027,8 @@ static void setup_sensor_data(struct ec_sensors_data *ec)
break;
}
}
- if (!bank_found) {
+ if (!bank_found)
ec->banks[ec->nr_banks++] = bank;
- }
s++;
}
sort(ec->banks, ec->nr_banks, 1, bank_compare, NULL);
@@ -1086,9 +1085,8 @@ static int asus_ec_bank_switch(u8 bank, u8 *old)
{
int status = 0;
- if (old) {
+ if (old)
status = ec_read(ASUS_EC_BANK_REGISTER, old);
- }
if (status || (old && (*old == bank)))
return status;
return ec_write(ASUS_EC_BANK_REGISTER, bank);
@@ -1125,9 +1123,8 @@ static int asus_ec_block_read(const struct device *dev,
}
for (ireg = 0; ireg < ec->nr_registers; ireg++) {
reg_bank = register_bank(ec->registers[ireg]);
- if (reg_bank < bank) {
+ if (reg_bank < bank)
continue;
- }
ec_read(register_index(ec->registers[ireg]),
ec->read_buffer + ireg);
}
@@ -1189,9 +1186,8 @@ static int update_ec_sensors(const struct device *dev,
status = asus_ec_block_read(dev, ec);
- if (!status) {
+ if (!status)
update_sensor_values(ec, ec->read_buffer);
- }
if (!ec->lock_data.unlock(&ec->lock_data))
dev_err(dev, "Failed to release mutex");
@@ -1240,9 +1236,8 @@ static int asus_ec_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
struct ec_sensors_data *state = dev_get_drvdata(dev);
int sidx = find_ec_sensor_index(state, type, channel);
- if (sidx < 0) {
+ if (sidx < 0)
return sidx;
- }
ret = get_cached_value_or_update(dev, sidx, state, &value);
if (!ret) {
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-09 20:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-09 19:24 [PATCH] hwmon: asus-ec-sensors: remove braces from single-statement blocks Josh Hesketh
2026-04-09 20:03 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®