Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2370714rdh; Sun, 26 Nov 2023 04:18:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyIkjkAUJSDL1vCObu9UY7tX+zqSaHot/G6F/smaCUTHYFvJd3MsZTjpru9Hn6AzyqYSAA X-Received: by 2002:a05:6a20:7d89:b0:189:b618:1736 with SMTP id v9-20020a056a207d8900b00189b6181736mr10068986pzj.57.1701001122619; Sun, 26 Nov 2023 04:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701001122; cv=none; d=google.com; s=arc-20160816; b=JYcGqD/r/OgipVksNw4WiFpaexUwje+HnMjHpYFrCOyavqp2X+439swKcgJ1cpb0yT DKkSFl67uYuK6OhpBUZKFPwnw1lMugL4N5FRd7LDz/tb1nnZIOMqD5StsIf7rFfk0uAr W1COebINfnV63Z4gLWpfSMqpxs1zXaedomP4kR5amJJjcfACMGZs+GpHnVE3hqYUww+0 MHKZpdrsxcGvvonyMyLPwbQsbQOL42aL5IQpt+WPtSrYfY4AY1pNQ4mOJuqmIScQy48L EJL62FgO8ewTOsYqkr5uT5AvpzKp+UxdeNwdmgfDhNFRzpgaAVsqGnNE89ZNDTkNIBOu Xsiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WQnUkaXZOIIpLEqtO9tP49RXTYTnAyGSIHZBDGOUB0Q=; fh=7DInq0VJtxCdS+mGw/BGp+j/gmLdKt4n2BrpyxLYR4M=; b=RpWwP7spYmINNxXb67P1biZafQFAm5oH5S1CrImeRuPmw6BFlu7kXlNtGn56eh6IAs wn9cN/41Ryu0K4Gy2MYcTDME2pSLiNg+/oFiG621asZYNYtuEjHtoBTBr6pFHh4VRCm7 JsZ71zcc3joLmqkqE48VTP7+Q+dbyhW3ypvhamuGRHDvWSnWgXQaeElAUq7CBUZKQfTi ZaMjP8qV57k1gac6X9QJbjYsMiOHGjm4E3w8dewSV71eBG0LN4vGdelD2JUzXMbakU4d x9qTep2n+fWoBTZ9CxDQzH1mo0AyEJCdjKGcodDAYop3nuGTYb4Bv2X2HnWoIVaEblnd dogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="e19O/nzC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i7-20020a17090a2ac700b002792c288cc3si7490342pjg.169.2023.11.26.04.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 04:18:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="e19O/nzC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B11EA8061B52; Sun, 26 Nov 2023 04:18:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbjKZMSV (ORCPT + 99 others); Sun, 26 Nov 2023 07:18:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjKZMSU (ORCPT ); Sun, 26 Nov 2023 07:18:20 -0500 Received: from xry111.site (xry111.site [89.208.246.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C1DDE for ; Sun, 26 Nov 2023 04:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1701001106; bh=Pp0VZl6n2le2LRNzVsUDddKmd4rLblALXSs+e/wVaNU=; h=From:To:Cc:Subject:Date:From; b=e19O/nzCGeMeuHB9xEiBiD5Ghr6iOhakbu7rdIEirCFZtleX1bZihbEuQMkx1apRy ATuSC50NTFlY6SKT4fJQK/xQYjxHcmfNaoYQ9vb0Fu8McYJXGN3p1ul6KvO4XJxKgW nO4jy7CLVRJCkqpf4WTRYj9yPjEgfIZWTwudsUlQ= Received: from stargazer.. (unknown [124.115.222.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id B2ED866B39; Sun, 26 Nov 2023 07:18:24 -0500 (EST) From: Xi Ruoyao To: Huacai Chen , WANG Xuerui Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Xi Ruoyao Subject: [PATCH] LoongArch: Slightly clean up drdtime Date: Sun, 26 Nov 2023 20:17:28 +0800 Message-ID: <20231126121727.47303-2-xry111@xry111.site> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_SBL_CSS,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 26 Nov 2023 04:18:41 -0800 (PST) As we are just discarding the stable clock ID, simply write it into $zero instead of allocating a temporary register. Signed-off-by: Xi Ruoyao --- arch/loongarch/include/asm/loongarch.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h index 9b4957cefa8a..46366e783c84 100644 --- a/arch/loongarch/include/asm/loongarch.h +++ b/arch/loongarch/include/asm/loongarch.h @@ -1098,12 +1098,11 @@ static __always_inline u64 drdtime(void) { - int rID = 0; u64 val = 0; __asm__ __volatile__( - "rdtime.d %0, %1 \n\t" - : "=r"(val), "=r"(rID) + "rdtime.d %0, $zero\n\t" + : "=r"(val) : ); return val; -- 2.43.0