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: <9b82413f1ca0b924cc139d945777e32dd22ffe41.1698575385.git.christophe.jaillet@wanadoo.fr>
Date:   Sun, 29 Oct 2023 11:30:06 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Coly Li <colyli@...e.de>,
        Kent Overstreet <kent.overstreet@...il.com>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        linux-bcache@...r.kernel.org
Subject: [PATCH] bcache: Optimize sysfs_hprint()

The size of what is in 'buf' is already computed by bch_hprint(), so skip
these bytes when calling strcat().

This easily saves a few cycles. (should it matter)

Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
 drivers/md/bcache/sysfs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/sysfs.h b/drivers/md/bcache/sysfs.h
index 65b8bd975ab1..798bcbeab0bb 100644
--- a/drivers/md/bcache/sysfs.h
+++ b/drivers/md/bcache/sysfs.h
@@ -78,7 +78,7 @@ do {									\
 do {									\
 	if (attr == &sysfs_ ## file) {					\
 		ssize_t ret = bch_hprint(buf, val);			\
-		strcat(buf, "\n");					\
+		strcat(buf + ret, "\n");				\
 		return ret + 1;						\
 	}								\
 } while (0)
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ