From patchwork Mon Dec 5 03:52:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 29510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2054886wrr; Sun, 4 Dec 2022 19:58:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf46VKT1/C+mLZtCeHG3EEfbcv7xc/skbf7KQ67xo7yNW7WrgN7enyyo8DXGwbNCilcObWoC X-Received: by 2002:a17:902:c085:b0:186:ff42:704d with SMTP id j5-20020a170902c08500b00186ff42704dmr66473630pld.153.1670212700327; Sun, 04 Dec 2022 19:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670212700; cv=none; d=google.com; s=arc-20160816; b=ZDI1ivew3yUnM7xxKn56nSctcsIobgcRiVF5sDxjmwhhKTam+BZpuRnXVtJhlV8B61 xsAqYbJDcRi+0sukGmEf4iLkJldgEwQLJO76CMcgYBH0+a2xWcwqFcdT6y5Xeho4qdSO 9eBZNKXzvp+cAqKERJj5y1E/NJAKXhDxTKbX9HeFVP73B/03O4dn9q6rg5Pkic0e9J4q sAGnoVNms3EE4ofOZ0b/FIwQNUZ02kmYjPlMlICwMCQFPdTncomWkzquBJaUiGbU0Vc0 oCVJqGDSqKkQMXTgx9epYfE4BqWytyu0lKJsl83Lib5bgCUjmZO03iWe9S1zb5PAGio4 fm4Q== 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=p4UckmS+ps1CB6U8b8bm+sc251m5zbxzOmoMx6gzMRI=; b=vfpzAMd+oGfhkXBgMCyZg96c70pvEhgzS0hzG/niJDg33XGyXMAtM05RaZTLIXLF1O GXFBEjm4iZOCtffUms/BCiQKlBP5Guh3ISoLaIinwelqCvq/na/fw0zEYbSNYIJhfCvQ up1R1HUP6OSe6nguBd8RoI3GISYjn2S6Zp1NKWRb4vufF1B7ysxzggoMUpTg7OVN5uA4 OZA90FeYC61RCTC3ps7E11A/aNQSWqmgGMo1Zd528riKtcUqzWtSMGNy/nm22QlsuvLY CKU+i2xSf3RsocdcY8zCCmORy4sl5o39q6ZRHb7gD8LS6h9YM6BEseCPHg9a/XidMb1R 8/6g== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 137-20020a63038f000000b0046b0e168af0si13496557pgd.597.2022.12.04.19.58.07; Sun, 04 Dec 2022 19:58:20 -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 S231260AbiLEDxJ (ORCPT + 99 others); Sun, 4 Dec 2022 22:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231415AbiLEDxE (ORCPT ); Sun, 4 Dec 2022 22:53:04 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA7149580; Sun, 4 Dec 2022 19:53:03 -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 4NQV4s2BVyz8R03d; Mon, 5 Dec 2022 11:53:01 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B53qtAN034087; Mon, 5 Dec 2022 11:52:55 +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 11:52:56 +0800 (CST) Date: Mon, 5 Dec 2022 11:52:56 +0800 (CST) X-Zmail-TransId: 2af9638d6b186bfdc340 X-Mailer: Zmail v1.0 Message-ID: <202212051152565871940@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , Subject: =?utf-8?q?=5BPATCH_net-next=5D_s390/qeth=3A_use_sysfs=5Femit=28=29_?= =?utf-8?q?to_instead_of_scnprintf=28=29?= X-MAIL: mse-fl2.zte.com.cn 2B53qtAN034087 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 638D6B1D.000 by FangMail milter! X-FangMail-Envelope: 1670212381/4NQV4s2BVyz8R03d/638D6B1D.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638D6B1D.000/4NQV4s2BVyz8R03d X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751344952551597848?= X-GMAIL-MSGID: =?utf-8?q?1751344952551597848?= 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 Reviewed-by: Alexandra Winter --- drivers/s390/net/qeth_l3_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index 1082380b21f8..65eea667e469 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c @@ -395,7 +395,7 @@ static ssize_t qeth_l3_dev_ipato_add_show(char *buf, struct qeth_card *card, } mutex_unlock(&card->ip_lock); - return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n"); + return str_len ? str_len : sysfs_emit(buf, "\n"); } static ssize_t qeth_l3_dev_ipato_add4_show(struct device *dev, @@ -614,7 +614,7 @@ static ssize_t qeth_l3_dev_ip_add_show(struct device *dev, char *buf, } mutex_unlock(&card->ip_lock); - return str_len ? str_len : scnprintf(buf, PAGE_SIZE, "\n"); + return str_len ? str_len : sysfs_emit(buf, "\n"); } static ssize_t qeth_l3_dev_vipa_add4_show(struct device *dev,