From mboxrd@z Thu Jan 1 00:00:00 1970 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 85B5CC4332F for ; Tue, 15 Nov 2022 12:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiKOMBd (ORCPT ); Tue, 15 Nov 2022 07:01:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbiKOMBc (ORCPT ); Tue, 15 Nov 2022 07:01:32 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62BE220C7 for ; Tue, 15 Nov 2022 04:01:29 -0800 (PST) Received: from mxde.zte.com.cn (unknown [10.35.20.121]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NBPsg6VfMz7PFN for ; Tue, 15 Nov 2022 20:01:27 +0800 (CST) Received: from mxus.zte.com.cn (unknown [10.207.168.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4NBPsP0bXDz9vSpd for ; Tue, 15 Nov 2022 20:01:13 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxus.zte.com.cn (FangMail) with ESMTPS id 4NBPsG4gzmzdmc15; Tue, 15 Nov 2022 20:01:06 +0800 (CST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NBPsC1Z6Rz8R039; Tue, 15 Nov 2022 20:01:03 +0800 (CST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NBPs713Fgz501Qj; Tue, 15 Nov 2022 20:00:59 +0800 (CST) Received: from szxlzmapp04.zte.com.cn ([10.5.231.166]) by mse-fl2.zte.com.cn with SMTP id 2AFC0rKn025108; Tue, 15 Nov 2022 20:00:53 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp04[null]) by mapi (Zmail) with MAPI id mid14; Tue, 15 Nov 2022 20:00:56 +0800 (CST) Date: Tue, 15 Nov 2022 20:00:56 +0800 (CST) X-Zmail-TransId: 2b0663737f78ffffffffffcf2e29 X-Mailer: Zmail v1.0 Message-ID: <202211152000566769480@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHBlcmYveDg2L2ludGVsL3B0OiB1c2Ugc3lzZnNfZW1pdCgpIHRvIGluc3RlYWQgb2Ygc2NucHJpbnRmKCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AFC0rKn025108 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.14.novalocal with ID 63737F96.000 by FangMail milter! X-FangMail-Envelope: 1668513688/4NBPsg6VfMz7PFN/63737F96.000/10.35.20.121/[10.35.20.121]/mxde.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63737F96.000/4NBPsg6VfMz7PFN Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org From: Xu Panda Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- arch/x86/events/intel/pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 82ef87e9a897..23e249e260f5 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -96,7 +96,7 @@ static ssize_t pt_cap_show(struct device *cdev, container_of(attr, struct dev_ext_attribute, attr); enum pt_capabilities cap = (long)ea->var; - return snprintf(buf, PAGE_SIZE, "%x\n", intel_pt_validate_hw_cap(cap)); + return sysfs_emit(buf, "%x\n", intel_pt_validate_hw_cap(cap)); } static struct attribute_group pt_cap_group __ro_after_init = { -- 2.15.2