diff mbox series

[v2] drm/nouveau/debugfs: Optimise data output in nouveau_debugfs_vbios_image()

Message ID 6636ae61-c112-48bb-acbd-89cc972cd282@web.de (mailing list archive)
State New, archived
Headers show
Series [v2] drm/nouveau/debugfs: Optimise data output in nouveau_debugfs_vbios_image() | expand

Commit Message

Markus Elfring July 23, 2024, 4:23 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 23 Jul 2024 18:08:15 +0200

Some characters should be put into a sequence.

* Thus print all data by the corresponding function “seq_write” at once.

* Return also the value from this function call.

* Omit a local variable which became redundant with this refactoring.


This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---

V2:
A patch review suggestion from Ilia Mirkin was integrated.

 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.45.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index e83db051e851..980cff265060 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -39,11 +39,8 @@  nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
-	int i;

-	for (i = 0; i < drm->vbios.length; i++)
-		seq_printf(m, "%c", drm->vbios.data[i]);
-	return 0;
+	return seq_write(m, drm->vbios.data, drm->vbios.length);
 }

 static int