drivers/input/mouse/elan_i2c_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Append newline characters to sysfs_emit() outputs in func min_show() and
max_show(). This aligns with common kernel conventions and improves
readability for userspace tools that expect newline-terminated values.
Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
---
drivers/input/mouse/elan_i2c_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index fee1796da3d0..14b6cfd7a6de 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -861,7 +861,7 @@ static ssize_t min_show(struct device *dev,
if (!data->baseline_ready)
return -ENODATA;
- return sysfs_emit(buf, "%d", data->min_baseline);
+ return sysfs_emit(buf, "%d\n", data->min_baseline);
}
return -EINTR;
@@ -877,7 +877,7 @@ static ssize_t max_show(struct device *dev,
if (!data->baseline_ready)
return -ENODATA;
- return sysfs_emit(buf, "%d", data->max_baseline);
+ return sysfs_emit(buf, "%d\n", data->max_baseline);
}
return -EINTR;
--
2.43.0
Hi Zhongqiu, On Thu, Oct 30, 2025 at 08:34:58PM +0800, Zhongqiu Han wrote: > Append newline characters to sysfs_emit() outputs in func min_show() and > max_show(). This aligns with common kernel conventions and improves > readability for userspace tools that expect newline-terminated values. This format for this driver was in use for 11 years, and there might be tools that do not expect newlines. I would rather leave it as is. Thanks. -- Dmitry
On 11/5/2025 12:55 PM, Dmitry Torokhov wrote: > Hi Zhongqiu, > > On Thu, Oct 30, 2025 at 08:34:58PM +0800, Zhongqiu Han wrote: >> Append newline characters to sysfs_emit() outputs in func min_show() and >> max_show(). This aligns with common kernel conventions and improves >> readability for userspace tools that expect newline-terminated values. > > This format for this driver was in use for 11 years, and there might be > tools that do not expect newlines. I would rather leave it as is. > > Thanks. > Hi Dmitry, Thanks for your review~ Sure, I agree that we should avoid breaking unknown userspace tools. -- Thx and BRs, Zhongqiu Han
© 2016 - 2026 Red Hat, Inc.