Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp909418pxb; Fri, 22 Apr 2022 14:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmhZIdO7bFpyPfb8VQjJhgKhA9UvV8iPF0GQKzoyO/EAbljUSuY7RSKYDhQA4B4vpe9gYN X-Received: by 2002:a05:6808:ecc:b0:322:319c:cd3 with SMTP id q12-20020a0568080ecc00b00322319c0cd3mr7730108oiv.148.1650661428693; Fri, 22 Apr 2022 14:03:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650661428; cv=pass; d=google.com; s=arc-20160816; b=0sf/rBBnTzmHJySwxq7DRVo4xmkLes9m2iPKXDrZP94uQq0qB9RZ2nlQ/q5Fuq9tpy A0T/Tx+jefFFxcG/fOEYDtbGm4U1Hhg+cBRChHY8V+S9O+6fxHp5gokFjP+ZnkQ0NxHC sZLSlzB/MHHP0RjtCbzMf4T9OQqJFd05KioK8hXsgiOzQDncmRMYtkl3j0TbefBmGhIw aWaeOVUko2GCf/a/gUaWieiYxW4Jlwb8qF3n+pK8zm5Se+TBQE9U+f69EqV8ET/8bBoR 4zENi1r2YAnmXEJ/3kmu6C8e4f+IEcf4nUpNmVbIsh3LU7naINzwgmBfR04ZR/HfZafJ sC9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=Ch2oW9CXStX2NYswOXomEzSEMwJKWVqWtZ5mRZfXcoA=; b=lO0iHTP8JgoD8jZF0kIy8s7Z0vHOIFuMsHk8zkzsWz5yFxM1SUv7i0fQmlzIHmcofc OfkqcjqyxkCNvWAOB/BugXMvj3cGr08dT8dsqeFpCfFc8kCO+NrNH/XQoc6jAeBCuIVu 4NIdwtmAoqbaEXKsDd28bq9wFxDsvc8nx7N1YUBPkM3PUCiRbczpOtvImSYHItIbYHJe XEDdsYeafMFQJ9EI0HyFlD3QcoJUttzj0buBx/aCRKXWEIG04A+S7DtuqDtZist8q621 bueUJ81Sj6YbnQm36XtrQHYyDk/68zf+0Oo2H4lkMPXuX6e79lMjFRgUa1EOYA3vDdCT y0fg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=SF3sbkiY; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y7-20020a0568301d8700b005ce04571159si5451066oti.292.2022.04.22.14.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:03:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=SF3sbkiY; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EC5A18A638; Fri, 22 Apr 2022 13:00:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443429AbiDVCko (ORCPT + 99 others); Thu, 21 Apr 2022 22:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245153AbiDVCkn (ORCPT ); Thu, 21 Apr 2022 22:40:43 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88DC34B43C; Thu, 21 Apr 2022 19:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CEPJQyGmeoCI8rPkBqvFfyB2id0b2H3xTPyuCRQfqA5HmIiM0R6lagnvarfNVGbz0DOKB7hNF+2BOR0fDPmmsVRBuAqs43PjUYKkAO6xOZQdj6MIYg/YcYle5p+KQHRj9fKfD8wkASoa41l001OcBB3jdwVcM5yqxzu2Khb98U99irmw+0uaDXajH7xOOL6wtZwHAZ9H/ii2IT5UCjlq3FmUg1sYoVkmCshQOJT3neVICRkJgMFglKso9L/eHKKCA34RD+/WnKoag9tD6otfhY17agdqg1kse5rjyUGxro7+2cgvj5kkKE6cd7Rpcdo2A5uOqCj+ENsmBUCpYPzabQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ch2oW9CXStX2NYswOXomEzSEMwJKWVqWtZ5mRZfXcoA=; b=Mn+8ze5DQquerwJj9sDYtsnlNQ4O3EigtOeg/AJc0jhftnFiLoKe33v/obbVA3xQ3DL8xnb/9dnhmXWHJBsav2DPJ2LAzXTlVEIBfOQRypU05RJvIh6/o9KxDOgwC4uQNObkC6PC0zDIX3qw3Rkm3H+POowtyU8Fe/WgZJna3GVQmb0SRx9n8ALjRk4HrSFOSToZxzBy+k0gfckH1pRq6SIEUaU98rhHcBIzAni2vrgjH7DMeLAE/xa2+FL0tuXugO2H2wwipV/2t8sQAPuKmQmfaE4Nn3DvIFI8YS6SRiKTLCT6OXn/ndZnaACDGX/0OQpuB+/R75MzboDHEdd5gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ch2oW9CXStX2NYswOXomEzSEMwJKWVqWtZ5mRZfXcoA=; b=SF3sbkiYAvabPnOefqaOHE8mQUF8g9HjbsqyT6tJiuh2w3V1vCjvTqZk8Or49Und17H68+/g5csOqZwhsmW1szGIWKZxe+has1/U2MpwoeNrEyHJyLI8g6pwUHwj6wVapy8aXw11xwWuoechOefgBn5Kf8UcmfjrGL0xyda7eiU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) by TY2PR06MB3375.apcprd06.prod.outlook.com (2603:1096:404:96::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.25; Fri, 22 Apr 2022 02:37:45 +0000 Received: from SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c]) by SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c%7]) with mapi id 15.20.5164.025; Fri, 22 Apr 2022 02:37:45 +0000 From: Wan Jiabing To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kael_w@yeah.net, Wan Jiabing Subject: [PATCH] perf/x86/amd: Replace snprintf() with sysfs_emit() Date: Fri, 22 Apr 2022 10:37:34 +0800 Message-Id: <20220422023734.129114-1-wanjiabing@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: HKAPR04CA0015.apcprd04.prod.outlook.com (2603:1096:203:d0::25) To SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92935aa9-b484-47f1-838d-08da240914b3 X-MS-TrafficTypeDiagnostic: TY2PR06MB3375:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dIsgSkS7Ci7bqmhoRKy+Yp4rNRoIT946ZkQ1V8D4M7DWjZDO49XvKRx1NjGqUkRUs97YZ6eZBCdZ2mrA+ipQDxbsXnIaYtZ5xuDswEWguPKBfLx4vIdtNdJ8HVsSyVZOT/hKVavwvdYknu1TUCzkQFXtFh9v6AFA8W1WJlyBe+o/V7eIdgxQJPOVsLiPd42oyxMU1p6cwMo+aGmYGjQjOIL+7/HoQOzj4RnVrRxTISzMvzrd6zTwyN9/WkCLks4TqAf8uFCdPXMraL0g+MQ/UXAacoIYmwasvgHPjXH+nas/rYdHz7sf6KE2YVSJPat9mrIubhuNaPiTXDsAxOx0dIRWqxAq2v6VWoNm6BlVmF3kobD54aXbGlRLIlJH7iRZOlCCthfHGVwquRhPlVsIX5tbmnWUdR+57J42uPeR+X9bykRrwEu7hdoON7ylAApMcq4VkQuet6DCA+Bfn1YSW6BwJoW47V7rCZB7RBRgNl0oMRycTvPuR0f4ANE6PXorJn8WmpISjIg0JAiDORp9/P1tIa87myFvz61FhD8XNLHmLXXyXFystEHiasHIaIciC/T4j5RbHL4vxebN4TfEWVQaso6PSHubZhN89P/+0Owm40MOCv8jk5crUQiRNM0MXLwwQqJiitgTy+AEOGt8v1K4HW6zGhH7wdBq4BdTUoAORqM8nl+jsHp0ljAjQkRX4x9MzJoVLfY+3144/2hocxVrvboz9800j/Uw4U0vE04= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3367.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(36756003)(52116002)(186003)(5660300002)(8936002)(1076003)(110136005)(316002)(6506007)(7416002)(2906002)(508600001)(6486002)(4326008)(8676002)(38100700002)(38350700002)(107886003)(66556008)(66476007)(66946007)(921005)(6666004)(2616005)(83380400001)(86362001)(4744005)(6512007)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?AKpmWHsIx3XBpNn0ZzjlwZpTf9RScAhLvFrAKt6alN9X3NqTWUsVe+okhFKq?= =?us-ascii?Q?2HJlestU+3ycvsaPrErNRtUbpm9hN5SJnG5vCDWy1ZC+ZrtBcbRCk43ACZrz?= =?us-ascii?Q?HYI35d2ozJrGQ113VdjrkabWrcmCARa+s6m09KX71Au6neAoQFRIM10qg8xP?= =?us-ascii?Q?l8Erp+uo34Wy8XvB/Q2XmlQFF7220Nn1AAt4WC+1STDiqgSEHImPEYhMjGSK?= =?us-ascii?Q?gKbQvsfZX30i31WOFS8KFsb/lPY7GfcipQx477KKjDbSIrDWWX9yrkDBvJst?= =?us-ascii?Q?G0u+tlNufq2BLLPTqdOCqX3j0FbdejPzezd5tRGT6Z/dq9iXJjVqGWcW8UkP?= =?us-ascii?Q?b0mTQ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7SjaLgDfreT++7aO?= =?us-ascii?Q?lz5EGYqjOhoBUTeOv+yXRptLxWVcA7sqAf7GMFyYoz58lOQAkYB7gN+pz5p3?= =?us-ascii?Q?1gB8B3yLrpgokdEMvR6Vt2dq34NDwhiMULlBCIlDG6tdmpHw0pJ3iukvD1Yt?= =?us-ascii?Q?+mE3gwPqbTvqQWnD4TEtBYLlxcd7Wuj9dD9EcSXT0NQvOC01A7/QwMymldxH?= =?us-ascii?Q?Cx9JIvQGqYAujCatb8AWzqB8NdaOTrUy/096749OVBt9BBkUjaMa8CqU3GML?= =?us-ascii?Q?SvOJ8MBPVtV5yg8kW6q3x5h6W2XItUPq9Zmz8iu1tRjRNQwpdDMA9SHfXV5D?= =?us-ascii?Q?SLZSYxZcgyj9o0+5mH3rs9kOAvX2N/2H+giBNakpt7RGtmezWaMiJmHLOp3B?= =?us-ascii?Q?bzXvYd7/uklX3jZVoa5041WFV3IjtZv7Q3c8SrT2lm1BhIYT2YpRDb0zA/Em?= =?us-ascii?Q?CW1EQc/toYEqHjSZv2vJoDvx81YHD7hOgXhrveb0XdQ8tetHsADlSlhgEA/x?= =?us-ascii?Q?kM+QYsg1NQ=3D=3D?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92935aa9-b484-47f1-838d-08da240914b3 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3367.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 02:37:44.9304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sU7as4HSJHjq25Uhk7lGUEZHdOg0+3yq/SE0gWHxQ/74DZjGjV1BISypeJ7fjvVyrpcR5abm7AOBiJRsTgihJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR06MB3375 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 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 Fix the following coccicheck warning: arch/x86/events/amd/core.c:1127:8-16: WARNING: use scnprintf or sprintf. Use sysfs_emit() instead of snprintf(). Signed-off-by: Wan Jiabing --- 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 8e1e818f8195..c1ced265c824 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -1124,7 +1124,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); -- 2.35.1