* [PATCH] tools: Change the division operator to a right shift operator
@ 2022-07-19 1:58 Lv qian
0 siblings, 0 replies; only message in thread
From: Lv qian @ 2022-07-19 1:58 UTC (permalink / raw)
To: shuah; +Cc: linux-kselftest, linux-kernel, kernel, Lv qian
Change the division operator to a right shift operator,Reduced assembly
code.
Signed-off-by: Lv qian <lvqian@nfschina.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-19 1:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 1:58 [PATCH] tools: Change the division operator to a right shift operator Lv qian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).