* [PATCH 1/2] drm/debugfs: Replace seq_printf with seq_puts for constant strings
2026-03-20 7:31 [PATCH 0/2] drm: Use seq_puts() for fixed string output liuqiangneo
@ 2026-03-20 7:31 ` liuqiangneo
2026-03-21 17:54 ` Claude review: " Claude Code Review Bot
2026-03-20 7:31 ` [PATCH 2/2] drm/dp_mst: " liuqiangneo
2026-03-21 17:54 ` Claude review: drm: Use seq_puts() for fixed string output Claude Code Review Bot
2 siblings, 1 reply; 6+ messages in thread
From: liuqiangneo @ 2026-03-20 7:31 UTC (permalink / raw)
To: maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: linux-kernel, dri-devel, Qiang Liu
From: Qiang Liu <liuqiang@kylinos.cn>
Replace seq_printf() with seq_puts() when printing constant strings
without format specifiers. This is more efficient as seq_puts()
doesn't need to parse the format string.
Signed-off-by: Qiang Liu <liuqiang@kylinos.cn>
---
drivers/gpu/drm/drm_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index ae1c6126c2c5..f9658bdf703e 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -66,7 +66,7 @@ static int drm_name_info(struct seq_file *m, void *data)
seq_printf(m, " master=%s", master->unique);
if (dev->unique)
seq_printf(m, " unique=%s", dev->unique);
- seq_printf(m, "\n");
+ seq_puts(m, "\n");
mutex_unlock(&dev->master_mutex);
return 0;
@@ -139,7 +139,7 @@ static int drm_gem_name_info(struct seq_file *m, void *data)
struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = entry->dev;
- seq_printf(m, " name size handles refcount\n");
+ seq_puts(m, " name size handles refcount\n");
mutex_lock(&dev->object_name_lock);
idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, m);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] drm/dp_mst: Replace seq_printf with seq_puts for constant strings
2026-03-20 7:31 [PATCH 0/2] drm: Use seq_puts() for fixed string output liuqiangneo
2026-03-20 7:31 ` [PATCH 1/2] drm/debugfs: Replace seq_printf with seq_puts for constant strings liuqiangneo
@ 2026-03-20 7:31 ` liuqiangneo
2026-03-21 17:54 ` Claude review: " Claude Code Review Bot
2026-03-21 17:54 ` Claude review: drm: Use seq_puts() for fixed string output Claude Code Review Bot
2 siblings, 1 reply; 6+ messages in thread
From: liuqiangneo @ 2026-03-20 7:31 UTC (permalink / raw)
To: maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: linux-kernel, dri-devel, Qiang Liu
From: Qiang Liu <liuqiang@kylinos.cn>
Replace seq_printf() with seq_puts() when printing constant strings
without format specifiers. This is more efficient as seq_puts()
doesn't need to parse the format string.
Signed-off-by: Qiang Liu <liuqiang@kylinos.cn>
---
drivers/gpu/drm/display/drm_dp_mst_topology.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index d8a732f21d3c..69fe2018eae5 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -4930,12 +4930,12 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
return;
state = to_drm_dp_mst_topology_state(mgr->base.state);
- seq_printf(m, "\n*** Atomic state info ***\n");
+ seq_puts(m, "\n*** Atomic state info ***\n");
seq_printf(m, "payload_mask: %x, max_payloads: %d, start_slot: %u, pbn_div: %d\n",
state->payload_mask, mgr->max_payloads, state->start_slot,
dfixed_trunc(state->pbn_div));
- seq_printf(m, "\n| idx | port | vcpi | slots | pbn | dsc | status | sink name |\n");
+ seq_puts(m, "\n| idx | port | vcpi | slots | pbn | dsc | status | sink name |\n");
for (i = 0; i < mgr->max_payloads; i++) {
list_for_each_entry(payload, &state->payloads, next) {
char name[14];
@@ -4957,28 +4957,28 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
}
}
- seq_printf(m, "\n*** DPCD Info ***\n");
+ seq_puts(m, "\n*** DPCD Info ***\n");
mutex_lock(&mgr->lock);
if (mgr->mst_primary) {
u8 buf[DP_PAYLOAD_TABLE_SIZE];
int ret;
if (drm_dp_read_dpcd_caps(mgr->aux, buf) < 0) {
- seq_printf(m, "dpcd read failed\n");
+ seq_puts(m, "dpcd read failed\n");
goto out;
}
seq_printf(m, "dpcd: %*ph\n", DP_RECEIVER_CAP_SIZE, buf);
ret = drm_dp_dpcd_read_data(mgr->aux, DP_FAUX_CAP, buf, 2);
if (ret < 0) {
- seq_printf(m, "faux/mst read failed\n");
+ seq_puts(m, "faux/mst read failed\n");
goto out;
}
seq_printf(m, "faux/mst: %*ph\n", 2, buf);
ret = drm_dp_dpcd_read_data(mgr->aux, DP_MSTM_CTRL, buf, 1);
if (ret < 0) {
- seq_printf(m, "mst ctrl read failed\n");
+ seq_puts(m, "mst ctrl read failed\n");
goto out;
}
seq_printf(m, "mst ctrl: %*ph\n", 1, buf);
@@ -4987,7 +4987,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
ret = drm_dp_dpcd_read_data(mgr->aux, DP_BRANCH_OUI, buf,
DP_BRANCH_OUI_HEADER_SIZE);
if (ret < 0) {
- seq_printf(m, "branch oui read failed\n");
+ seq_puts(m, "branch oui read failed\n");
goto out;
}
seq_printf(m, "branch oui: %*phN devid: ", 3, buf);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread