* [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs
@ 2026-03-28 4:45 Shivam Gupta
2026-03-28 6:02 ` Greg KH
2026-03-30 9:35 ` Dan Carpenter
0 siblings, 2 replies; 5+ messages in thread
From: Shivam Gupta @ 2026-03-28 4:45 UTC (permalink / raw)
To: gregkh, johan, elder
Cc: vaibhav.sr, mgreer, greybus-dev, linux-staging, linux-kernel,
Shivam Gupta
sysfs_emit outputs in audio_manager_module.c do not include a terminating
newline, which is required for proper sysfs formatting.
Add newline characters to all sysfs_emit format strings.
Signed-off-by: Shivam Gupta <shivgupta751157@gmail.com>
---
drivers/staging/greybus/audio_manager_module.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index dc90cc2d2308..5737f2a32f5a 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -75,7 +75,7 @@ static void gb_audio_module_release(struct kobject *kobj)
static ssize_t gb_audio_module_name_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
- return sysfs_emit(buf, "%s", module->desc.name);
+ return sysfs_emit(buf, "%s\n", module->desc.name);
}
static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
@@ -84,7 +84,7 @@ static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
static ssize_t gb_audio_module_vid_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
- return sysfs_emit(buf, "%d", module->desc.vid);
+ return sysfs_emit(buf, "%d\n", module->desc.vid);
}
static struct gb_audio_manager_module_attribute gb_audio_module_vid_attribute =
@@ -93,7 +93,7 @@ static struct gb_audio_manager_module_attribute gb_audio_module_vid_attribute =
static ssize_t gb_audio_module_pid_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
- return sysfs_emit(buf, "%d", module->desc.pid);
+ return sysfs_emit(buf, "%d\n", module->desc.pid);
}
static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
@@ -103,7 +103,7 @@ static ssize_t gb_audio_module_intf_id_show(struct gb_audio_manager_module *modu
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
- return sysfs_emit(buf, "%d", module->desc.intf_id);
+ return sysfs_emit(buf, "%d\n", module->desc.intf_id);
}
static struct gb_audio_manager_module_attribute
@@ -114,7 +114,7 @@ static ssize_t gb_audio_module_ip_devices_show(struct gb_audio_manager_module *m
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
- return sysfs_emit(buf, "0x%X", module->desc.ip_devices);
+ return sysfs_emit(buf, "0x%X\n", module->desc.ip_devices);
}
static struct gb_audio_manager_module_attribute
@@ -125,7 +125,7 @@ static ssize_t gb_audio_module_op_devices_show(struct gb_audio_manager_module *m
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
- return sysfs_emit(buf, "0x%X", module->desc.op_devices);
+ return sysfs_emit(buf, "0x%X\n", module->desc.op_devices);
}
static struct gb_audio_manager_module_attribute
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs
2026-03-28 4:45 [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs Shivam Gupta
@ 2026-03-28 6:02 ` Greg KH
2026-03-28 14:51 ` Hadi Chokr
2026-03-30 9:35 ` Dan Carpenter
1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2026-03-28 6:02 UTC (permalink / raw)
To: Shivam Gupta
Cc: johan, elder, vaibhav.sr, mgreer, greybus-dev, linux-staging,
linux-kernel
On Sat, Mar 28, 2026 at 10:15:27AM +0530, Shivam Gupta wrote:
> sysfs_emit outputs in audio_manager_module.c do not include a terminating
> newline, which is required for proper sysfs formatting.
>
> Add newline characters to all sysfs_emit format strings.
>
> Signed-off-by: Shivam Gupta <shivgupta751157@gmail.com>
You just changed the user/kernel api here, are you _sure_ it is ok to do
so? What tools just broke or were used to test this? What tool asked
you to make this change?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs
2026-03-28 6:02 ` Greg KH
@ 2026-03-28 14:51 ` Hadi Chokr
2026-03-30 9:35 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Hadi Chokr @ 2026-03-28 14:51 UTC (permalink / raw)
To: Greg KH, Shivam Gupta
Cc: johan, elder, vaibhav.sr, mgreer, greybus-dev, linux-staging,
linux-kernel
> On Sat, Mar 28, 2026 at 10:15:27AM +0530, Shivam Gupta wrote:
>> sysfs_emit outputs in audio_manager_module.c do not include a terminating
>> newline, which is required for proper sysfs formatting.
>>
>> Add newline characters to all sysfs_emit format strings.
>>
>> Signed-off-by: Shivam Gupta <shivgupta751157@gmail.com>
> You just changed the user/kernel api here, are you _sure_ it is ok to do
> so? What tools just broke or were used to test this? What tool asked
> you to make this change?
>
> thanks,
>
> greg k-h
>
I'm not the author, but I've been going through the staging tree,
running checkpatch on various files, and reading documentation to get
started with kernel development. This particular file
(`drivers/staging/greybus/audio_manager_module.c`) triggers checkpatch
warnings about missing newlines in `sysfs_emit` calls.
It seems fine to make this change tho, as it reflects the proper kernel
API documented in `Documentation/filesystems/sysfs.rst`. One of the
examples at line 266 shows the intended behaviour as:
static ssize_t show_name(struct device *dev, struct
device_attribute *attr,
char *buf)
{
return sysfs_emit(buf, "%s\n", dev->name);
}
So to answer the question: checkpatch flagged it, and the kernel
documentation confirms this is the correct usage of the function.
Happy to help.
Hadi Chokr
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs
2026-03-28 4:45 [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs Shivam Gupta
2026-03-28 6:02 ` Greg KH
@ 2026-03-30 9:35 ` Dan Carpenter
1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2026-03-30 9:35 UTC (permalink / raw)
To: Shivam Gupta
Cc: gregkh, johan, elder, vaibhav.sr, mgreer, greybus-dev,
linux-staging, linux-kernel
On Sat, Mar 28, 2026 at 10:15:27AM +0530, Shivam Gupta wrote:
> sysfs_emit outputs in audio_manager_module.c do not include a terminating
> newline, which is required for proper sysfs formatting.
>
> Add newline characters to all sysfs_emit format strings.
>
> Signed-off-by: Shivam Gupta <shivgupta751157@gmail.com>
> ---
"Proper sysfs format" is all well and good, but this is something which
already exists and adding a newline is changing the API. If you were a
maintainer of this code, then I would have more confidence that you know
all the user space code which uses this API and are able to test it
thouroughly.
We merged a similar change recently and, whatever, that's fine, probably
it doesn't break anything. But the more we do it, the more likely we
are to break something so my instinct is that we should discourage this
kind of change.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs
2026-03-28 14:51 ` Hadi Chokr
@ 2026-03-30 9:35 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2026-03-30 9:35 UTC (permalink / raw)
To: Hadi Chokr
Cc: Greg KH, Shivam Gupta, johan, elder, vaibhav.sr, mgreer,
greybus-dev, linux-staging, linux-kernel
The "don't break user space" rule is more important than style
guidelines.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-30 9:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 4:45 [PATCH] staging: greybus: audio_manager: Add missing newline to sysfs_emit outputs Shivam Gupta
2026-03-28 6:02 ` Greg KH
2026-03-28 14:51 ` Hadi Chokr
2026-03-30 9:35 ` Dan Carpenter
2026-03-30 9:35 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox