Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3388216rwb; Wed, 30 Nov 2022 20:37:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7BrPvh6iV/0HxRLOr+2awgoZl34wZ3PAEekfvFGa3TMCbJSMXhhZ8VQecZALyZmD3RmfqT X-Received: by 2002:a17:90b:2690:b0:213:f2c9:ce71 with SMTP id pl16-20020a17090b269000b00213f2c9ce71mr68110853pjb.62.1669869464165; Wed, 30 Nov 2022 20:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669869464; cv=none; d=google.com; s=arc-20160816; b=rvNXP4rrQ0lI/RwmOtlegDGboGK6ZiprUVT+AcmrelxcsQKUya9Awu5b3C6Ge/Fc1w sM1frst2YyOlxVjdAXZ2nAJ3Yqh2mOy4DE8Vl2SN9PWyxUu6VnvI5jQxjpt4hZ3SDBbw 3SK8eGpTarWnMTeOFM0coxlebU13jxQeGTzk092Wid/12LOybkPYCPu/XV+4nRJQIXP9 l8k+Xsu7p1oVPJQAXToxsF0DSH2RgDgYQvbrn5O4u6z+tIVOi6Wg8WN/ap0NRgy+pvey 3RCLHFmq193kpPHgC5GKm30NfHwrkEkZQmm2fN2W9174ssyiKJziqbfET1QFUQzVCi77 BmUQ== 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=R6PGTsPGUqN4DsK/YJj7/bqbLSaQvW6r8JoArvOgH0Y=; b=HcIJ6VMx9W1CKT37ldzPZHOiWBvoleDpEQnfw/iAMUHuQEQXG7BBgZYtrc8wYVMuuH MchPb6T1d+JTgH/Gc2iaMvKysJMdkgDEiRjT9YijeZdRxsFMGy5sTj/knObr8GoakoSs LbsB0oqrb+kXK7/iG2qSdcpWnk/G5Z54Uwu1jeqf7CUpU9D9w2aaPPZZp2UxF+jEbvzl EBgZbcU10jta4B0zMoq83VJBKsfdWYfWAgX2hE0z9UQ/l86c7UMdBoTi6qexVIPcYwS8 hEZKTrhxOJ4e88ZGMYwxfMaZBSVKgpSPDg5jm/p+kDaRgv9Ca6/UGKIfz0Qcmx2hMpDP f69w== 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 p21-20020a170902b09500b0018863e1bc39si3159303plr.248.2022.11.30.20.37.26; Wed, 30 Nov 2022 20:37:44 -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 S229683AbiLAD4v (ORCPT + 83 others); Wed, 30 Nov 2022 22:56:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbiLAD4s (ORCPT ); Wed, 30 Nov 2022 22:56:48 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281BB57B7F; Wed, 30 Nov 2022 19:56:44 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (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 4NN2Ly4xLZz4y0v1; Thu, 1 Dec 2022 11:56:42 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2B13uTup079150; Thu, 1 Dec 2022 11:56:30 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 1 Dec 2022 11:56:31 +0800 (CST) Date: Thu, 1 Dec 2022 11:56:31 +0800 (CST) X-Zmail-TransId: 2af9638825ef20c9e3b7 X-Mailer: Zmail v1.0 Message-ID: <202212011156314630626@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?UTF-8?B?W1BBVENIXSBpaW86IGNvbW1vbjogc2NtaV9paW86IHVzZSBzeXNmc19lbWl0KCkgdG8gaW5zdGVhZCBvZgoKIHNjbnByaW50Zigp?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2B13uTup079150 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638825FA.000 by FangMail milter! X-FangMail-Envelope: 1669867002/4NN2Ly4xLZz4y0v1/638825FA.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638825FA.000/4NN2Ly4xLZz4y0v1 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 Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen --- drivers/iio/common/scmi_sensors/scmi_iio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/common/scmi_sensors/scmi_iio.c index d92f7f651f7b..0c2caf3570db 100644 --- a/drivers/iio/common/scmi_sensors/scmi_iio.c +++ b/drivers/iio/common/scmi_sensors/scmi_iio.c @@ -400,12 +400,12 @@ static ssize_t scmi_iio_get_raw_available(struct iio_dev *iio_dev, rem = do_div(resolution, int_pow(10, abs(exponent)) ); - len = scnprintf(buf, PAGE_SIZE, + len = sysfs_emit(buf, "[%lld %llu.%llu %lld]\n", min_range, resolution, rem, max_range); } else { resolution = resolution * int_pow(10, exponent); - len = scnprintf(buf, PAGE_SIZE, "[%lld %llu %lld]\n", + len = sysfs_emit(buf, "[%lld %llu %lld]\n", min_range, resolution, max_range); } } -- 2.25.1