From patchwork Sun Nov 27 13:00:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 26355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5107526wrr; Sun, 27 Nov 2022 05:11:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TEjgSaU2Lhzp/cjRY7eTkWtYOTlLDMUiZUP4odvhqp48yJdA91/guNc7r6fhWCCq+/N+g X-Received: by 2002:a63:e506:0:b0:43c:2e57:9798 with SMTP id r6-20020a63e506000000b0043c2e579798mr25634667pgh.590.1669554707519; Sun, 27 Nov 2022 05:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669554707; cv=none; d=google.com; s=arc-20160816; b=ljAV5FBtkDrvhWvNiXSRUzHcimjF/WZun2YHGCK+bez8w3OrcoPe8CLhXrVv0Awn6H ZiIxDWePCM5CMAoL89hpqchpOHksZdtVRtnqkbr9yLVaFGsqHj22clR/9QCeUd4MHyhc UMclX81neYUSuVoO3K4buIUXh9q10wURnql2P/sIQNgH+iGSa4geuX7tRoD+jGAli5jo 8KYdGP8ID9mS/ionVhBaVhcCPehutOnx/uIb45jgEaW3Zy1N+akyEnEddM8G7eN49ZZt rNWpA11xw/HA7o3kPAEYfExWMJRv3fPhuFtQweEh/B94CTNmeI7Tf61VI/cMTcS3z62O XRQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=QCVOfoXHjQK+VN3bvx9UzZlm3VMOip+OF4xvSuscVg8=; b=V46YkMBtTxHGwIz8if4MFPhQwPSugs4V7Hn+vLjeVfi+vAPqmhmXqIra6Jkb/E54j9 mxItiYuqgX6AgJabT5jnJI/hzYbnwa38bmXGfaLoOZeTrzB8/xUwFlVVf7LYosk3TcHY R66Q/7oLLpCs5nBZXA4B0Tdyd9uffyWqtAk4542mh8Maowpuk4BprArjGsysCKFxDYwP LxD2tWd69PK0LqmgRN89zcooioKCgq2OPA/KauuhJx6D3Ot22r2wKd6g9EnJjgZ/94Cw NRNK13g/hBkwK9d5mGxJp6zaMVugCu5Lhiy+IADLj3MPea40xdUXTM9h0bZBEx4UvXLE C9zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om1-20020a17090b3a8100b0020d542eb5f0si13112150pjb.110.2022.11.27.05.11.34; Sun, 27 Nov 2022 05:11:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbiK0NB2 (ORCPT + 99 others); Sun, 27 Nov 2022 08:01:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiK0NBU (ORCPT ); Sun, 27 Nov 2022 08:01:20 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 80C25B49B; Sun, 27 Nov 2022 05:01:19 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 27 Nov 2022 21:00:33 +0800 (GMT+08:00) X-Originating-IP: [182.148.15.36] Date: Sun, 27 Nov 2022 21:00:33 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf/x86/amd/lbr:convert sysfs snprintf to sysfs_emit X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <228a1b59.1d5.184b92cd4b9.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXn+ByX4NjpXIFAA--.100W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQADB2FEYx0G1gAIsG X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750654997186816605?= X-GMAIL-MSGID: =?utf-8?q?1750654997186816605?= Fix the following coccicheck warning: arch/x86/events/amd/core.c:1276:8-16: WARNING: use scnprintf or sprintf Signed-off-by: KaiLong Wang --- arch/x86/events/amd/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index d6f3703e4119..5db384f6ca4c 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -1272,7 +1272,7 @@ static ssize_t branches_show(struct device *cdev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu.lbr_nr); + return sysfs_emit(buf, "%d\n", x86_pmu.lbr_nr); } static DEVICE_ATTR_RO(branches);