From patchwork Tue Jul 19 01:58:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv qian X-Patchwork-Id: 12921995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7961FC43334 for ; Tue, 19 Jul 2022 01:59:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236225AbiGSB7C (ORCPT ); Mon, 18 Jul 2022 21:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233620AbiGSB7C (ORCPT ); Mon, 18 Jul 2022 21:59:02 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7153D3A4A7; Mon, 18 Jul 2022 18:59:00 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 51F531E80D46; Tue, 19 Jul 2022 09:54:54 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DLrHpBEHnVGZ; Tue, 19 Jul 2022 09:54:51 +0800 (CST) Received: from localhost.localdomain.localdomain (unknown [219.141.250.2]) (Authenticated sender: lvqian@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id AA89C1E80D10; Tue, 19 Jul 2022 09:54:51 +0800 (CST) From: Lv qian To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@nfschina.com, Lv qian Subject: [PATCH] tools: Change the division operator to a right shift operator Date: Tue, 19 Jul 2022 09:58:18 +0800 Message-Id: <20220719015818.3260-1-lvqian@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Change the division operator to a right shift operator,Reduced assembly code. Signed-off-by: Lv qian --- 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");