Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6136791rwb; Wed, 18 Jan 2023 01:24:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtOopU0WVnD05moTtKZiQfXA3J30evICj1x8vI5NF17bSC6vA6qHalDn1tCpgTTc3QN66pa X-Received: by 2002:a17:90a:ce8b:b0:229:2a63:9a5d with SMTP id g11-20020a17090ace8b00b002292a639a5dmr6157562pju.29.1674033871864; Wed, 18 Jan 2023 01:24:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674033871; cv=pass; d=google.com; s=arc-20160816; b=bWuvL+5AbNTk9f3Gbi+sgEJZmzntkvAQkj8lod2vwgAAdnwtieVCQiPelI5pFe+niQ mFq+C3+8RctVtvbqXfIPkVnSntWnuhO0Z3y57vcPPdl2qX88zs37y/Qgq1U9A4eEl6sK NdcH2EYdwHA3SL2RTq8AMVaSZ9O9Lugzuu7KVzDCLza5LwBocq+j14oD0ecPr3FT1ieA YaE5qZ3iTlIMQ8tSRovw6CI5JNFpzaVp5h8LhREgvp0q1F926kV0ORJztPQIbeSUWzi8 jqqS2B4V4Oi6LzpGHwVbZb7WpKohUp6mriezrjjtSaBQ9Lua1W5OeuHjXg6mAv6rI7L2 YRIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=32pMiOlV7Ishsq6tGX0Ullqnoye0YjjxIeEj2mFpxv8=; b=kqiuXSaCJEZi8nrbsmR69Xtd2ii/Bq7CLEJtP4yuFXs8FOJVDKSaqJY8aQVmKmRReQ W2jKqBEFB1LH6laVh0+KWW9V4sK86vd9NYDgNEdrs3HWY5JazgljnMTSHJsW0MdYbO5p 3lv1jeqKxcRO9GWNGObFdA6jE6c3UOvKhfasfHHM9ZnbfahaU575DYJ30M9bkhRkQAyk 9cZUn2OOM3N+Y0Nr3eI7Dk2nyAk+fCEzfJ/R9r3dzw/Xg0NgU+BkyYRQS2fM+bUDD3yM U1JPVMk4so1yx21EVkxqcw+zRMwXTXLMFtSiSmMc3vxVODXdBhIsvBKp5F75P45fe5Wa kXTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=X5YAWGxQ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nw11-20020a17090b254b00b002213d9c01cdsi1622986pjb.136.2023.01.18.01.24.26; Wed, 18 Jan 2023 01:24:31 -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; dkim=pass header.i=@amd.com header.s=selector1 header.b=X5YAWGxQ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbjARIaf (ORCPT + 46 others); Wed, 18 Jan 2023 03:30:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjARI0F (ORCPT ); Wed, 18 Jan 2023 03:26:05 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2041.outbound.protection.outlook.com [40.107.100.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5FC5B5AD; Tue, 17 Jan 2023 23:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ba6Q93CJ82bZGbm/tp+nQU74FknRGo/v2/J8HlSdUTYevrGltyuuRwv3vYHio5J8HEpl0LOSo4YTaIopO0RbpIUFMnBs+akpBIRhS5XuwSq2k5AiyQrzl5/vtVIVFlztWDg9dTqc+enzCIubhvbzuyRhvJ7zj72JHteQ4LXOVgY62cVM5xwCqTkLNIlsFgzuUMZZhLT1FLM68r0LUOzkYsLn2cT4hIhRioi+ACgRt2Nt/5zk9bEIXbrq6rYQITGfn2y45mK3mw0aITUcYCQzoyRccmVNlhSkUzlDxrzINkMRJanTxdO8BwFioUslIztvnmwadhmbfqkyavphngqdkQ== 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=32pMiOlV7Ishsq6tGX0Ullqnoye0YjjxIeEj2mFpxv8=; b=UT6kKZFmGU5bbQi+p26hFMrevZf5Ri5ulwWL9nXqIUJ3OJR288aFKrmvEe5+BYf4Xj/LQl2IcHyr9j66zCLa169X0+DP383rxbD/wUylBYq6Rk4ApyuY7lTISX84dIWhSRwQSRdFZ9tj5U5TPJXacCtYreHLyT0yR/Wa6FGhR1r2AtovqwLoFrV9n4Ly1ZanA8PPC2mpBEsWaAMN5DIJztEOu5QN1OvDu5/IrwhuNjHHumMImZguAnKIH8ZO6Li8IUYW/oR5t/MYBhO/jmsdjD3MOSqyv8J3/9uvMZ8XPTCUhAi1jNJqsrQ7/mVeLLosaY/Ir9rLa/L7Z3g6FQCFmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=32pMiOlV7Ishsq6tGX0Ullqnoye0YjjxIeEj2mFpxv8=; b=X5YAWGxQ9vFf9AkThIkXUTFyj9Vdk/B4ty9tKsOHAfEf/XEoLf/cSW5vDTIXSieHHuCGelh7LEl6qhUmLNHJxT3adAtbVHBemSfjKpguqpigEowI+Q6i20zMaqMFHhzpkSI2N65oTdbMuddTg34/iXR13iIpWukg/CT7b75RiDs= Received: from MW2PR2101CA0009.namprd21.prod.outlook.com (2603:10b6:302:1::22) by SA0PR12MB4416.namprd12.prod.outlook.com (2603:10b6:806:99::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Wed, 18 Jan 2023 07:53:21 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:302:1:cafe::e) by MW2PR2101CA0009.outlook.office365.com (2603:10b6:302:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.5 via Frontend Transport; Wed, 18 Jan 2023 07:53:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Wed, 18 Jan 2023 07:53:20 +0000 Received: from pyuan-Cloudripper.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 18 Jan 2023 01:53:16 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , Subject: [PATCH v11 10/11] cpufreq: amd-pstate: convert sprintf with sysfs_emit() Date: Wed, 18 Jan 2023 15:52:09 +0800 Message-ID: <20230118075210.447418-11-perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230118075210.447418-1-perry.yuan@amd.com> References: <20230118075210.447418-1-perry.yuan@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT013:EE_|SA0PR12MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e2eed60-f4d8-4383-d3ca-08daf9291198 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CN6ACeba/fobCRD8eXR+sWzyZKDtBGq9peLAoUUgidRTjkG2mJLkeBQbzrJY00GnwDN07UsjPQwpajrcf22zsIkEs8vBjxiBBNW7S0HsAq1owkgEl9mky7rpsoAFv2a+oEQwMTHiwtFXa2VrnRbhHQyH3XeW4gsRP42q7QgmzEAS8rLw7SHIEBW1XqHwrXTFCI2inq9LXOKi56FDZND8kCOduCn2r+QwrqEXVi71JYJ/vbo/mWZSgF2GRmWb4FdiLnAr/Nnqk1fXFGMzZncHprxsxoY+Ycr5Ag6b39vESxf1QsiEXLVRp+ncuzBXhGYVe5YOUxzWWzumw6r5AugKIY8geM7sR6QB1sWeel4nEOAwzQYkVQwZfTzbStCLZDoIeK/OIYypo36Lt1h+uhr5l9QrnmscQKxKS/ObGRVLMY5CW3SeDDyaxNxwKCfx2AxJzn2D4MiivXfMjgGJuLdDLO+2+zGExTwMHgepKoVkTot5BU4HRJKU9cvW0N43iNC8IxByCjbWq3AKEu1jxlDEwHETz49EBcYhTfKpLpD220Oz5N9oCfcg1Zdad//oAdU/2nlzgtvD41VyLXDTsQrvj7sQV/IgEAmka5BrdpzZie/lqmyy3AGLzTykwlcfOsxEA7SX6QTXgslolup5UPl33Jip45ojWQbEsVpmpLIp/FzkWkulA3KjMFaGGfbqUoxVYbU1LFH0KXNd4uLlSsEeESkwIpje3mXOjrGjxG7L5l0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199015)(40470700004)(46966006)(36840700001)(86362001)(356005)(2906002)(44832011)(70586007)(70206006)(8936002)(5660300002)(82740400003)(81166007)(36860700001)(54906003)(110136005)(6666004)(47076005)(426003)(7696005)(316002)(478600001)(36756003)(82310400005)(41300700001)(8676002)(4326008)(40480700001)(16526019)(186003)(1076003)(336012)(83380400001)(26005)(40460700003)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2023 07:53:20.8987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e2eed60-f4d8-4383-d3ca-08daf9291198 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4416 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 replace the sprintf with a more generic sysfs_emit function No intended potential function impact Acked-by: Huang Rui Tested-by: Wyes Karny Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 2e5e594dc41e..c307d67a76ae 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -694,7 +694,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, if (max_freq < 0) return max_freq; - return sprintf(&buf[0], "%u\n", max_freq); + return sysfs_emit(buf, "%u\n", max_freq); } static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy, @@ -707,7 +707,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli if (freq < 0) return freq; - return sprintf(&buf[0], "%u\n", freq); + return sysfs_emit(buf, "%u\n", freq); } /* @@ -722,7 +722,7 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, perf = READ_ONCE(cpudata->highest_perf); - return sprintf(&buf[0], "%u\n", perf); + return sysfs_emit(buf, "%u\n", perf); } static ssize_t show_energy_performance_available_preferences( -- 2.34.1