[PATCH v2] drm/nouveau/debugfs: Optimise data output in nouveau_debugfs_vbios_image()
Markus Elfring
Markus.Elfring at web.de
Tue Jul 23 16:23:51 UTC 2024
From: Markus Elfring <elfring at 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 at 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(-)
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
--
2.45.2
More information about the dri-devel
mailing list