Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5294737rwb; Sun, 4 Dec 2022 18:41:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mQPSDmsc8IJgX405lfwn8jG7e44LE4Q/SjmWvuEPmehWefP1+stnw5DgeBi2mnp3F/0pr X-Received: by 2002:a17:906:442:b0:7ad:7d4a:ec2c with SMTP id e2-20020a170906044200b007ad7d4aec2cmr52818780eja.710.1670208071534; Sun, 04 Dec 2022 18:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670208071; cv=none; d=google.com; s=arc-20160816; b=jdtBPCuROlwgjwPuD6ZUvJSP46j3hBlqpwwyNpTLrVb17DaFZzMkTZ+H1pz2d9Wu+L fksLDMWvuXjc+5ZbIhlesecv9RDF4adOAUMt/LOKO8WaxtU/9DgyQ5aqiPx8LT5k7rNc V6GdRmNCl3HNWVQd6OgZFRVohFhsIIP/PGpAHaIABSs6zBtp/YLHT2QhYb1m3JVp4N+9 inrEWAl8Z4YaxAyAlteP+iezm5Eya7nIZLbJavAD7E5rvymMHVr2xY7WMcsibSTigco7 hiVmq9ycV153t0ST/RUYhN//zcwPCC5ImFMmXiEYv/ZXBz/uXMJGvz5TQnww/9UBDJyy i4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=XWEbvMp4T43io6fl9fD6VdHJIw+hpjE399lEWLX1caY=; b=bWgkHZdV0R+JK7HyurAlAEU8ksYXyd3RHXU0WQIQ218TdG6XDH6d+grzAt1ZwBAW9+ uh+yrpIdJqSMCUPwtDq3BPk2CbsQcHEyaFbO9P7FNzOs1gmFYCrWq9e7teD+p6zoH3xy Zw8HXAwORexlI9FtPSnPehIOFTeQ3DuKgbW+uvcSdRIbr8URdgXT5QpKLFeU5dLxROZP 9AQY+t+UtH1PnXD8SSQOu4QofS3VsBPzzjy2Q+zOqJrTYEVbby3grktQnMpuIYKRRlx2 4ILUbyr7sajkgVznrqs542ebHgtYFCKGwlPnYY3K88n76X5evHPpC+0yEXLutcWE6CNx AtKg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a05640243c600b004591f959c3bsi4462415edc.427.2022.12.04.18.40.51; Sun, 04 Dec 2022 18:41:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231187AbiLECVz (ORCPT + 82 others); Sun, 4 Dec 2022 21:21:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiLECVy (ORCPT ); Sun, 4 Dec 2022 21:21:54 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F54212AA6; Sun, 4 Dec 2022 18:21:51 -0800 (PST) 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 mxhk.zte.com.cn (FangMail) with ESMTPS id 4NQS3f2Q0yz4xVnd; Mon, 5 Dec 2022 10:21:50 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B52LiXx009508; Mon, 5 Dec 2022 10:21:44 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Mon, 5 Dec 2022 10:21:45 +0800 (CST) Date: Mon, 5 Dec 2022 10:21:45 +0800 (CST) X-Zmail-TransId: 2af9638d55b9fffffffff3709c8b X-Mailer: Zmail v1.0 Message-ID: <202212051021451139126@zte.com.cn> Mime-Version: 1.0 From: To: , Cc: , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIG5ldC1uZXh0IHYyXSBzZmM6IHVzZSBzeXNmc19lbWl0KCkgdG8gaW5zdGVhZCBvZiBzY25wcmludGYoKQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2B52LiXx009508 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 638D55BE.001 by FangMail milter! X-FangMail-Envelope: 1670206910/4NQS3f2Q0yz4xVnd/638D55BE.001/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638D55BE.001/4NQS3f2Q0yz4xVnd X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 From: ye xingchen Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen --- v1 -> v2 Fix the Subject. drivers/net/ethernet/sfc/efx_common.c | 2 +- drivers/net/ethernet/sfc/siena/efx_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c index c2224e41a694..cc30524c2fe4 100644 --- a/drivers/net/ethernet/sfc/efx_common.c +++ b/drivers/net/ethernet/sfc/efx_common.c @@ -1164,7 +1164,7 @@ static ssize_t mcdi_logging_show(struct device *dev, struct efx_nic *efx = dev_get_drvdata(dev); struct efx_mcdi_iface *mcdi = efx_mcdi(efx); - return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled); + return sysfs_emit(buf, "%d\n", mcdi->logging_enabled); } static ssize_t mcdi_logging_store(struct device *dev, diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index 1fd396b00bfb..e4b294b8e9ac 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -1178,7 +1178,7 @@ static ssize_t mcdi_logging_show(struct device *dev, struct efx_nic *efx = dev_get_drvdata(dev); struct efx_mcdi_iface *mcdi = efx_mcdi(efx); - return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled); + return sysfs_emit(buf, "%d\n", mcdi->logging_enabled); } static ssize_t mcdi_logging_store(struct device *dev, -- 2.25.1