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-next>] [day] [month] [year] [list]
Message-ID: <22563348-fefa-8540-9d71-de37764f0596@web.de>
Date:   Tue, 2 Jul 2019 17:40:21 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     kernel-janitors@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] openpromfs: Adjust three seq_printf() calls in
 property_show()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 2 Jul 2019 17:24:27 +0200

A bit of information should be put into a sequence.
Thus improve the execution speed for this data output by better usage
of corresponding functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/openpromfs/inode.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index e6cb7689fec4..2234103fd8ee 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -76,14 +76,14 @@ static int property_show(struct seq_file *f, void *v)
 		while (len > 0) {
 			int n = strlen(pval);

-			seq_printf(f, "%s", (char *) pval);
+			seq_puts(f, (char *) pval);

 			/* Skip over the NULL byte too.  */
 			pval += n + 1;
 			len -= n + 1;

 			if (len > 0)
-				seq_printf(f, " + ");
+				seq_puts(f, " + ");
 		}
 	} else {
 		if (len & 3) {
@@ -111,8 +111,7 @@ static int property_show(struct seq_file *f, void *v)
 			}
 		}
 	}
-	seq_printf(f, "\n");
-
+	seq_putc(f, '\n');
 	return 0;
 }

--
2.22.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ