From patchwork Wed Dec 7 02:01:39 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: 30596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3162803wrr; Tue, 6 Dec 2022 18:07:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pDqSGNcEDZV2PrHK49N7jUBo2oSnQSIKjjas1rxk/8TVjNI3OQGnyGyUuCy6khogTRAq4 X-Received: by 2002:a17:903:22ca:b0:189:cca6:3971 with SMTP id y10-20020a17090322ca00b00189cca63971mr16254673plg.89.1670378874819; Tue, 06 Dec 2022 18:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670378874; cv=none; d=google.com; s=arc-20160816; b=NduNppV59e6LA8KEmiWgWdAtGOoAL+uQAwC7MkVpUF5tngK/WFmcJpx3+D2vQ0J+xI xJjLeJgd5+jeS/dVVSdERlD/bEScFZ4euVMfkXluUb0fGrbX2cqZUZeVECl/0HZ4BZlL w7kJYdx17t1xGJ7xfNCPlLbQ7SaOmMYwAtnQmSf+Rf+t1BarVnr+vXrjQHEZQ19ojjaX 87wHnV8zk2c/03RcabnG3Wh22HfuEctsYI85TgoeWYIh4AjmkhqpBkO3UfOadyPghBiK 8xvfXHfMYi2Ym7NPBj6qjKThGMx90Ofl4kGPw7WWAwejWVyNxIRA78kmWGak9/eSxWsa 0I3A== 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=/UaYGxm8S03nODMvTLj7k5ABBB4oC6+bO5UeyVsrGMM=; b=O90zjI9Qm4GYnN499GAQEMe3oNy5Jh9GY5OUamkYvtO6pWS2WzPYLeDjxkYXaKC80T W/D+5lUyAWaiBX8CV58oi4y7H3oAf14lSBfK/KzxyLuTu7coGaD0If2vzRSkWGY0GbYT GUwxEaI7UJQ6nbvVah9EzZQyE/8V7xAMZnvaxueaPzkfJrsr1yWFO83iX8mO36jrwGiJ s+BzEXbsVQfVD+t2a1E4QJ1QfrCKVdra+RlYU59Ht7lLGLDRq14VaI5HHXg2oV9U0E+g s0B3GYk9LfkimhtLsqEjIXg1GVRdH6WlQ5/ceE5NOYMTVHHptyHhjD7umEeRxMJeQjgr ep2g== 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 t12-20020a170902e1cc00b001897bfc97fesi17503796pla.54.2022.12.06.18.07.40; Tue, 06 Dec 2022 18:07:54 -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 S229448AbiLGCB7 (ORCPT + 99 others); Tue, 6 Dec 2022 21:01:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiLGCBv (ORCPT ); Tue, 6 Dec 2022 21:01:51 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C74F532D5; Tue, 6 Dec 2022 18:01:50 -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 4NRgWc3dRsz5BNRf; Wed, 7 Dec 2022 10:01:48 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.40.52]) by mse-fl2.zte.com.cn with SMTP id 2B721eZ1033016; Wed, 7 Dec 2022 10:01:40 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 7 Dec 2022 10:01:39 +0800 (CST) Date: Wed, 7 Dec 2022 10:01:39 +0800 (CST) X-Zmail-TransId: 2af9638ff403ffffffffc1f06b83 X-Mailer: Zmail v1.0 Message-ID: <202212071001393275575@zte.com.cn> Mime-Version: 1.0 From: To: , Cc: , , , Subject: =?utf-8?q?=5BPATCH=5D_iio=3A_adxl372=3A_Convert_to_use_sysfs=5Femit?= =?utf-8?q?=5Fat=28=29_API?= X-MAIL: mse-fl2.zte.com.cn 2B721eZ1033016 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 638FF40C.000 by FangMail milter! X-FangMail-Envelope: 1670378508/4NRgWc3dRsz5BNRf/638FF40C.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638FF40C.000/4NRgWc3dRsz5BNRf 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751519198907429620?= X-GMAIL-MSGID: =?utf-8?q?1751519198907429620?= 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 --- drivers/iio/accel/adxl372.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c index c4193286eb05..15bcb0d75b8f 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -970,8 +970,7 @@ static ssize_t adxl372_show_filter_freq_avail(struct device *dev, size_t len = 0; for (i = 0; i <= st->odr; i++) - len += scnprintf(buf + len, PAGE_SIZE - len, - "%d ", adxl372_bw_freq_tbl[i]); + len += sysfs_emit_at(buf, len, "%d ", adxl372_bw_freq_tbl[i]); buf[len - 1] = '\n';