lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6636ae61-c112-48bb-acbd-89cc972cd282@web.de>
Date: Tue, 23 Jul 2024 18:23:51 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
 kernel-janitors@...r.kernel.org,
 Christophe Jaillet <christophe.jaillet@...adoo.fr>,
 Daniel Vetter <daniel@...ll.ch>, Danilo Krummrich <dakr@...hat.com>,
 David Airlie <airlied@...il.com>, Ilia Mirkin <imirkin@...m.mit.edu>,
 Karol Herbst <kherbst@...hat.com>, Lyude Paul <lyude@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] drm/nouveau/debugfs: Optimise data output in
 nouveau_debugfs_vbios_image()

From: Markus Elfring <elfring@...rs.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@...rs.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ