public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mei: bus: Add newline to sysfs attribute outputs
@ 2025-10-30 12:30 Zhongqiu Han
  2025-10-30 12:32 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Zhongqiu Han @ 2025-10-30 12:30 UTC (permalink / raw)
  To: alexander.usyskin, arnd, gregkh; +Cc: linux-kernel, zhongqiu.han

Append newline characters to sysfs_emit() outputs in func max_conn_show(),
fixed_show(), and vtag_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/misc/mei/bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 2c810ab12e62..8876c79bacfb 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -1210,7 +1210,7 @@ static ssize_t max_conn_show(struct device *dev, struct device_attribute *a,
 	struct mei_cl_device *cldev = to_mei_cl_device(dev);
 	u8 maxconn = mei_me_cl_max_conn(cldev->me_cl);
 
-	return sysfs_emit(buf, "%d", maxconn);
+	return sysfs_emit(buf, "%d\n", maxconn);
 }
 static DEVICE_ATTR_RO(max_conn);
 
@@ -1220,7 +1220,7 @@ static ssize_t fixed_show(struct device *dev, struct device_attribute *a,
 	struct mei_cl_device *cldev = to_mei_cl_device(dev);
 	u8 fixed = mei_me_cl_fixed(cldev->me_cl);
 
-	return sysfs_emit(buf, "%d", fixed);
+	return sysfs_emit(buf, "%d\n", fixed);
 }
 static DEVICE_ATTR_RO(fixed);
 
@@ -1230,7 +1230,7 @@ static ssize_t vtag_show(struct device *dev, struct device_attribute *a,
 	struct mei_cl_device *cldev = to_mei_cl_device(dev);
 	bool vt = mei_me_cl_vt(cldev->me_cl);
 
-	return sysfs_emit(buf, "%d", vt);
+	return sysfs_emit(buf, "%d\n", vt);
 }
 static DEVICE_ATTR_RO(vtag);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mei: bus: Add newline to sysfs attribute outputs
  2025-10-30 12:30 [PATCH] mei: bus: Add newline to sysfs attribute outputs Zhongqiu Han
@ 2025-10-30 12:32 ` Greg KH
  2025-10-30 13:11   ` Zhongqiu Han
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2025-10-30 12:32 UTC (permalink / raw)
  To: Zhongqiu Han; +Cc: alexander.usyskin, arnd, linux-kernel

On Thu, Oct 30, 2025 at 08:30:00PM +0800, Zhongqiu Han wrote:
> Append newline characters to sysfs_emit() outputs in func max_conn_show(),
> fixed_show(), and vtag_show(). This aligns with common kernel conventions
> and improves readability for userspace tools that expect
> newline-terminated values.

What userspace tool reads these values today?  Will this user/kernel api
break them?  How was this tested?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mei: bus: Add newline to sysfs attribute outputs
  2025-10-30 12:32 ` Greg KH
@ 2025-10-30 13:11   ` Zhongqiu Han
  2025-11-03  0:25     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Zhongqiu Han @ 2025-10-30 13:11 UTC (permalink / raw)
  To: Greg KH; +Cc: alexander.usyskin, arnd, linux-kernel, zhongqiu.han

On 10/30/2025 8:32 PM, Greg KH wrote:
> On Thu, Oct 30, 2025 at 08:30:00PM +0800, Zhongqiu Han wrote:
>> Append newline characters to sysfs_emit() outputs in func max_conn_show(),
>> fixed_show(), and vtag_show(). This aligns with common kernel conventions
>> and improves readability for userspace tools that expect
>> newline-terminated values.
> 
> What userspace tool reads these values today?  Will this user/kernel api
> break them?  How was this tested?
> 
> thanks,
> 
> greg k-h

Hi Greg,
Thanks for your review~

Apologies for the confusion in the commit message — there isn't
actually a userspace tool that depends on the newline in this case. I
just made the change to follow common sysfs formatting practices and
improve consistency.

If you'd prefer the patch to be dropped or revised, I will proceed
accordingly.

-- 
Thx and BRs,
Zhongqiu Han

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mei: bus: Add newline to sysfs attribute outputs
  2025-10-30 13:11   ` Zhongqiu Han
@ 2025-11-03  0:25     ` Greg KH
  2025-11-03 13:43       ` Zhongqiu Han
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2025-11-03  0:25 UTC (permalink / raw)
  To: Zhongqiu Han; +Cc: alexander.usyskin, arnd, linux-kernel

On Thu, Oct 30, 2025 at 09:11:34PM +0800, Zhongqiu Han wrote:
> On 10/30/2025 8:32 PM, Greg KH wrote:
> > On Thu, Oct 30, 2025 at 08:30:00PM +0800, Zhongqiu Han wrote:
> > > Append newline characters to sysfs_emit() outputs in func max_conn_show(),
> > > fixed_show(), and vtag_show(). This aligns with common kernel conventions
> > > and improves readability for userspace tools that expect
> > > newline-terminated values.
> > 
> > What userspace tool reads these values today?  Will this user/kernel api
> > break them?  How was this tested?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi Greg,
> Thanks for your review~
> 
> Apologies for the confusion in the commit message — there isn't
> actually a userspace tool that depends on the newline in this case. I
> just made the change to follow common sysfs formatting practices and
> improve consistency.

That's fine, but please work with the people that wrote the tools that
depend on these files today to verify it will not break anything, and
then resubmit the patch with that information in the changelog.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mei: bus: Add newline to sysfs attribute outputs
  2025-11-03  0:25     ` Greg KH
@ 2025-11-03 13:43       ` Zhongqiu Han
  0 siblings, 0 replies; 5+ messages in thread
From: Zhongqiu Han @ 2025-11-03 13:43 UTC (permalink / raw)
  To: Greg KH; +Cc: alexander.usyskin, arnd, linux-kernel, zhongqiu.han

On 11/3/2025 8:25 AM, Greg KH wrote:
> On Thu, Oct 30, 2025 at 09:11:34PM +0800, Zhongqiu Han wrote:
>> On 10/30/2025 8:32 PM, Greg KH wrote:
>>> On Thu, Oct 30, 2025 at 08:30:00PM +0800, Zhongqiu Han wrote:
>>>> Append newline characters to sysfs_emit() outputs in func max_conn_show(),
>>>> fixed_show(), and vtag_show(). This aligns with common kernel conventions
>>>> and improves readability for userspace tools that expect
>>>> newline-terminated values.
>>>
>>> What userspace tool reads these values today?  Will this user/kernel api
>>> break them?  How was this tested?
>>>
>>> thanks,
>>>
>>> greg k-h
>>
>> Hi Greg,
>> Thanks for your review~
>>
>> Apologies for the confusion in the commit message — there isn't
>> actually a userspace tool that depends on the newline in this case. I
>> just made the change to follow common sysfs formatting practices and
>> improve consistency.
> 
> That's fine, but please work with the people that wrote the tools that
> depend on these files today to verify it will not break anything, and
> then resubmit the patch with that information in the changelog.
> 
> thanks,
> 
> greg k-h

Hi Greg,

Thank you for your feedback. I’m happy to work on this, but I’m
currently not aware of any userspace tools that depend on these sysfs
interfaces, so I can’t confirm the impact right now. I will check and
monitor it and make sure to verify before next resubmitting.


-- 
Thx and BRs,
Zhongqiu Han

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-03 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 12:30 [PATCH] mei: bus: Add newline to sysfs attribute outputs Zhongqiu Han
2025-10-30 12:32 ` Greg KH
2025-10-30 13:11   ` Zhongqiu Han
2025-11-03  0:25     ` Greg KH
2025-11-03 13:43       ` Zhongqiu Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox