[PATCH] tools: Change the division operator to a right shift operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Lv qian <lvqian@xxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux