Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp158127rwb; Tue, 6 Dec 2022 18:53:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ctj5QRk6hP6RyXwJBun5Je6qb1z83eP36v6oVdMB2FKFXEAYhyv7T24CNsFPyuR7jsxUI X-Received: by 2002:a17:902:f78a:b0:186:5bbc:2ad9 with SMTP id q10-20020a170902f78a00b001865bbc2ad9mr84621774pln.157.1670381623219; Tue, 06 Dec 2022 18:53:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670381623; cv=none; d=google.com; s=arc-20160816; b=bmcOORM5/s2+sai9s2rFac086wmbYchdw94QFR+uFDW4h9i8Ic1PJJyrQ5IPTherW9 IUg3B6zy0pnj+fdodBBQnhvvX1lZV0RV6vbeIx6y3DiqcRxJIQ/4ow1PS5gIBlQl1gES 2t9gO27EtxwVsLdpphUryOQBAlk4KElkzdHEAiQrzafjVN9G4JSKw8pP4dGP/jn6/OH2 zR/PdajI3rY3ZvazSnon0MF9qxO4NNL6Con1PhuVNYw1wYpaAi6JEspTw9NA6Y/GX4ai ATMB8apbeA1uZAZrZX/3h+zFAMj0sVEnpWTOyVjuTRhjxsjorZ9Q0O68sv6FiZ+hs1ca E+/Q== 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=wZg4+j78iHeGi7WS4IoNwZ5zlcY4/GNmyJwAr0a9PDg=; b=abL+qtessR2cK7ivBSUhboNlTzs2hOLGUvCiVEMtDcuKOYjw9i0JhilbW91HH2EDBS GMGAYEyQefSwk6TF4CfJfvt0PDGMqCNd3uV7xCj2cdzJfyDNt4TVzYTw5HFoDYeRaWD1 EYWvIQDf2OMwpK8YCMAtr0LUDz2+QzKGyrIGQIXLvu57m0laZ5kxpitM1M0seSyQXpIS u5RhF+Y21s4hjKGCMx9rbocuY4oWh+qKRAy0MmwvhWkt1saEA1ubJ8aYYYa5ZrGlzdRP mOZyEOLQVjbmXZ9cUyuW2HzQceoy8p4lZ2FGeZbRI+1OO48eNYzGd55Zjo4DQzixauDt bkqQ== 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 a25-20020a637059000000b0047764bac806si6050262pgn.749.2022.12.06.18.53.32; Tue, 06 Dec 2022 18:53:43 -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 S229719AbiLGCDh (ORCPT + 77 others); Tue, 6 Dec 2022 21:03:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbiLGCDf (ORCPT ); Tue, 6 Dec 2022 21:03:35 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD0B31EDC; Tue, 6 Dec 2022 18:03:34 -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 mxct.zte.com.cn (FangMail) with ESMTPS id 4NRgYd031tz501Qj; Wed, 7 Dec 2022 10:03:33 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2B723I0T034447; Wed, 7 Dec 2022 10:03:18 +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:03:19 +0800 (CST) Date: Wed, 7 Dec 2022 10:03:19 +0800 (CST) X-Zmail-TransId: 2af9638ff4670360af95 X-Mailer: Zmail v1.0 Message-ID: <202212071003192805636@zte.com.cn> Mime-Version: 1.0 From: To: , Cc: , , , , , , Subject: =?UTF-8?B?W1BBVENIXSBpaW86IGJtYTE4MDogQ29udmVydCB0byB1c2Ugc3lzZnNfZW1pdF9hdCgpIEFQSQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2B723I0T034447 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638FF475.000 by FangMail milter! X-FangMail-Envelope: 1670378613/4NRgYd031tz501Qj/638FF475.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638FF475.000/4NRgYd031tz501Qj 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 --- drivers/iio/accel/bma180.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index eb697eeb4301..9e3e5dfdded7 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -488,8 +488,7 @@ static ssize_t bma180_show_avail(char *buf, const int *vals, unsigned int n, for (i = 0; i < n; i++) { if (!vals[i]) continue; - len += scnprintf(buf + len, PAGE_SIZE - len, - micros ? "0.%06d " : "%d ", vals[i]); + len += sysfs_emit_at(buf, len, micros ? "0.%06d " : "%d ", vals[i]); } buf[len - 1] = '\n'; -- 2.25.1