mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] mcb update for 6.17
@ 2025-07-07  7:47 Johannes Thumshirn
  2025-07-07  7:47 ` [PATCH 1/1] mcb: use sysfs_emit_at() instead of scnprintf() in show functions Johannes Thumshirn
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Thumshirn @ 2025-07-07  7:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Johannes Thumshirn

Hi Greg,

Here's the single change I've colleded for MCB this cycle.

Abhinav Ananthu (1):
  mcb: use sysfs_emit_at() instead of scnprintf() in show functions

 drivers/mcb/mcb-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.50.0


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

* [PATCH 1/1] mcb: use sysfs_emit_at() instead of scnprintf() in show functions
  2025-07-07  7:47 [PATCH 0/1] mcb update for 6.17 Johannes Thumshirn
@ 2025-07-07  7:47 ` Johannes Thumshirn
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Thumshirn @ 2025-07-07  7:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Abhinav Ananthu, Johannes Thumshirn

From: Abhinav Ananthu <abhinav.ogl@gmail.com>

This change improves clarity and ensures proper bounds checking in
line with the preferred sysfs_emit() API usage for sysfs 'show'
functions. The PAGE_SIZE check is now handled internally by the helper.

No functional change intended.

Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
---
 drivers/mcb/mcb-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index 9b8c40a6459a..c1367223e71a 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -107,7 +107,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
 {
 	struct mcb_bus *bus = to_mcb_bus(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%d\n", bus->revision);
+	return sysfs_emit(buf, "%d\n", bus->revision);
 }
 static DEVICE_ATTR_RO(revision);
 
@@ -116,7 +116,7 @@ static ssize_t model_show(struct device *dev, struct device_attribute *attr,
 {
 	struct mcb_bus *bus = to_mcb_bus(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%c\n", bus->model);
+	return sysfs_emit(buf, "%c\n", bus->model);
 }
 static DEVICE_ATTR_RO(model);
 
@@ -125,7 +125,7 @@ static ssize_t minor_show(struct device *dev, struct device_attribute *attr,
 {
 	struct mcb_bus *bus = to_mcb_bus(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%d\n", bus->minor);
+	return sysfs_emit(buf, "%d\n", bus->minor);
 }
 static DEVICE_ATTR_RO(minor);
 
@@ -134,7 +134,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr,
 {
 	struct mcb_bus *bus = to_mcb_bus(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%s\n", bus->name);
+	return sysfs_emit(buf, "%s\n", bus->name);
 }
 static DEVICE_ATTR_RO(name);
 
-- 
2.50.0


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

end of thread, other threads:[~2025-07-07  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-07  7:47 [PATCH 0/1] mcb update for 6.17 Johannes Thumshirn
2025-07-07  7:47 ` [PATCH 1/1] mcb: use sysfs_emit_at() instead of scnprintf() in show functions Johannes Thumshirn

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

all inboxes | Powered by JetHome®