Message ID | 202212071530024612241@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp36848wrr; Tue, 6 Dec 2022 23:36:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf7EHVnqjfMsdWBuZjRcf5Aj5p6ZMM+qQlNN4tJfKOa4m6ho/7cUV0GsSPBo9Iqhv68cQDVP X-Received: by 2002:a17:906:e244:b0:7c0:f9ec:1dff with SMTP id gq4-20020a170906e24400b007c0f9ec1dffmr9481714ejb.283.1670398594187; Tue, 06 Dec 2022 23:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670398594; cv=none; d=google.com; s=arc-20160816; b=gabDZRCV+FtDpVCWiDp5OAcA8LStA2bqtHGyP+esSAIRFb3BusyPiXBnCqm2a+G+zi CKctzs9U9KQXmhGcndVdqUmdT8gnInAHu0OFcs+6/E6q0l+KicRu9wXFCqaYRnjnT8QD UkBopPNU50n4KCaUomXmz7bx8Y5TmDiMZolpP4MHcpLSul2mdyn+GkgI5CI543trA4kW cumj5KQ7ODoTwdlPfVlNGeyfzDGUw2dlleMob9r9EOz/VlUtd5Y1SXfNMVgkZD/YXmGk j/J9wC9teVYfth1ivcpy5QGg/SDGKMVhibxk4ycpp1e9SiSSKpZTz0eKutiYj6AJZ3WT 62qg== 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=g0y899V3MQOZciKCmSPwQFVB1HTo19llOX0K9L8LceQ=; b=brEh8Fo4XtheZDx3mz0sky3BwqWhVYIDspqyIXxlVPU7PBKVn5TmyV3fYkIAtz4tky 2HSyMXUk4cSfKv+HJIFFVe92tUGAg0pR6x9x5Qw9aoTnQlk+7rSkkmOj/GXcrEJFcYIA WoXGyWYHezPZPfcYPCPLAQ/b25QnjCI/0ZNyLC7zZToY7qgXqj5nvcxajKa8ugHve8L5 hBXZYG+TznqvyDOLtnoB7x3W5LxTpx0p51dFFEATmBWIPMSjalyluq7c53e9zRDf4qJM TpVPtFkUs5ReDSL1nK2acJiqnhCH+nc/h8iiYpt+/QnlAtRpRsUZ4+gXY0GILCzOUirC 6dJw== 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 hr32-20020a1709073fa000b0078cdba56108si6586844ejc.296.2022.12.06.23.36.10; Tue, 06 Dec 2022 23:36:34 -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 S229658AbiLGHa2 (ORCPT <rfc822;b08248@gmail.com> + 99 others); Wed, 7 Dec 2022 02:30:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiLGHa0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Dec 2022 02:30:26 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 143F5286F3; Tue, 6 Dec 2022 23:30:25 -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 mxhk.zte.com.cn (FangMail) with ESMTPS id 4NRppl4GWsz4xVnn; Wed, 7 Dec 2022 15:30:23 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2B77U07c030668; Wed, 7 Dec 2022 15:30:00 +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 15:30:02 +0800 (CST) Date: Wed, 7 Dec 2022 15:30:02 +0800 (CST) X-Zmail-TransId: 2af9639040faffffffff9356b636 X-Mailer: Zmail v1.0 Message-ID: <202212071530024612241@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <jic23@kernel.org> Cc: <lars@metafoo.de>, <andriy.shevchenko@linux.intel.com>, <michael.hennerich@analog.com>, <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH=5D_iio=3A_ad7606=3A_Convert_to_use_sysfs=5Femit?= =?utf-8?q?=5Fat=28=29_API?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2B77U07c030668 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 6390410F.005 by FangMail milter! X-FangMail-Envelope: 1670398223/4NRppl4GWsz4xVnn/6390410F.005/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/<ye.xingchen@zte.com.cn> X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6390410F.005/4NRppl4GWsz4xVnn 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751539876677003284?= X-GMAIL-MSGID: =?utf-8?q?1751539876677003284?= |
Series |
iio: ad7606: Convert to use sysfs_emit_at() API
|
|
Commit Message
ye.xingchen@zte.com.cn
Dec. 7, 2022, 7:30 a.m. UTC
From: ye xingchen <ye.xingchen@zte.com.cn> 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 <ye.xingchen@zte.com.cn> --- drivers/iio/adc/ad7606.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index dd6b603f65ea..8d462b66fb21 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -205,8 +205,7 @@ static ssize_t ad7606_show_avail(char *buf, const unsigned int *vals, int i; for (i = 0; i < n; i++) { - len += scnprintf(buf + len, PAGE_SIZE - len, - micros ? "0.%06u " : "%u ", vals[i]); + len += sysfs_emit_at(buf, len, micros ? "0.%06u " : "%u ", vals[i]); } buf[len - 1] = '\n';