From: Josh Hesketh <josh.hesketh@gmail.com>
To: eugene.shalygin@gmail.com, linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Josh Hesketh <josh.hesketh@gmail.com>
Subject: [PATCH] hwmon: asus-ec-sensors: remove braces from single-statement blocks
Date: Thu, 9 Apr 2026 20:24:38 +0100 [thread overview]
Message-ID: <20260409192438.15383-1-josh.hesketh@gmail.com> (raw)
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
next reply other threads:[~2026-04-09 19:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 19:24 Josh Hesketh [this message]
2026-04-09 20:03 ` [PATCH] hwmon: asus-ec-sensors: remove braces from single-statement blocks 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=20260409192438.15383-1-josh.hesketh@gmail.com \
--to=josh.hesketh@gmail.com \
--cc=eugene.shalygin@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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