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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220719015818.3260-1-lvqian@nfschina.com>
Date:   Tue, 19 Jul 2022 09:58:18 +0800
From:   Lv qian <lvqian@...china.com>
To:     shuah@...nel.org
Cc:     linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...china.com, Lv qian <lvqian@...china.com>
Subject: [PATCH] tools: Change the division operator to a right shift operator

Change the division operator to a right shift operator,Reduced assembly
code.

Signed-off-by: Lv qian <lvqian@...china.com>
---
 tools/testing/selftests/size/get_size.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/size/get_size.c b/tools/testing/selftests/size/get_size.c
index 2980b1a63366..b1e34408f8c6 100644
--- a/tools/testing/selftests/size/get_size.c
+++ b/tools/testing/selftests/size/get_size.c
@@ -73,7 +73,7 @@ static int print_k_value(const char *s, unsigned long num, unsigned long units)
 	print(s);
 
 	temp = num;
-	temp = (temp * units)/1024;
+	temp = (temp * units)>>10;
 	num = temp;
 	ccode = print_num(num);
 	print("\n");
-- 
2.18.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ