* [PATCH] hwmon: Fix minor style issues
@ 2026-10-28 8:15 himanshu bakshi
2026-10-28 8:21 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: himanshu bakshi @ 2026-10-28 8:15 UTC (permalink / raw)
To: linux; +Cc: linux-hwmon, linux-kernel, Himanshu Bakshi
From: Himanshu Bakshi <himanshu.bakshi478@gmail.com>
Add newline between variable declarations and executable statements
to address the checkpatch warnings.
Signed-off-by: Himanshu Bakshi <himanshu.bakshi478@gmail.com>
---
drivers/hwmon/adm1031.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index 24d0d4146c87..45d75a6383f5 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -212,6 +212,7 @@ static struct adm1031_data *adm1031_update_device(struct device *dev)
static int FAN_TO_REG(int reg, int div)
{
int tmp;
+
tmp = FAN_FROM_REG(clamp_val(reg, 0, 65535), div);
return tmp > 255 ? 255 : tmp;
}
@@ -322,6 +323,7 @@ static ssize_t fan_auto_channel_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", GET_FAN_AUTO_BITFIELD(data, nr));
}
@@ -387,6 +389,7 @@ static ssize_t auto_temp_off_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n",
AUTO_TEMP_OFF_FROM_REG(data->auto_temp[nr]));
}
@@ -395,6 +398,7 @@ static ssize_t auto_temp_min_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n",
AUTO_TEMP_MIN_FROM_REG(data->auto_temp[nr]));
}
@@ -425,6 +429,7 @@ static ssize_t auto_temp_max_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n",
AUTO_TEMP_MAX_FROM_REG(data->auto_temp[nr]));
}
@@ -468,6 +473,7 @@ static ssize_t pwm_show(struct device *dev, struct device_attribute *attr,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", PWM_FROM_REG(data->pwm[nr]));
}
static ssize_t pwm_store(struct device *dev, struct device_attribute *attr,
@@ -569,6 +575,7 @@ static ssize_t fan_div_show(struct device *dev, struct device_attribute *attr,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[nr]));
}
static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr,
@@ -576,6 +583,7 @@ static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n",
FAN_FROM_REG(data->fan_min[nr],
FAN_DIV_FROM_REG(data->fan_div[nr])));
@@ -668,6 +676,7 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
int ext;
+
ext = nr == 0 ?
((data->ext_temp[nr] >> 6) & 0x3) * 2 :
(((data->ext_temp[nr] >> ((nr - 1) * 3)) & 7));
@@ -678,6 +687,7 @@ static ssize_t temp_offset_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n",
TEMP_OFFSET_FROM_REG(data->temp_offset[nr]));
}
@@ -686,6 +696,7 @@ static ssize_t temp_min_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[nr]));
}
static ssize_t temp_max_show(struct device *dev,
@@ -693,6 +704,7 @@ static ssize_t temp_max_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[nr]));
}
static ssize_t temp_crit_show(struct device *dev,
@@ -700,6 +712,7 @@ static ssize_t temp_crit_show(struct device *dev,
{
int nr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[nr]));
}
static ssize_t temp_offset_store(struct device *dev,
@@ -812,6 +825,7 @@ static ssize_t alarms_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", data->alarm);
}
@@ -822,6 +836,7 @@ static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
{
int bitnr = to_sensor_dev_attr(attr)->index;
struct adm1031_data *data = adm1031_update_device(dev);
+
return sprintf(buf, "%d\n", (data->alarm >> bitnr) & 1);
}
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-28 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 8:15 [PATCH] hwmon: Fix minor style issues himanshu bakshi
2026-10-28 8:21 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox