From patchwork Wed Dec 7 07:32:27 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: 30672 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp36946wrr; Tue, 6 Dec 2022 23:36:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf41TLq3uBfE3p38dJ/FfRqHBrOm2OdIS9uB6STk7fLatX+tSKyqnulQ+er7SmAdn2p/F30N X-Received: by 2002:a05:6402:240b:b0:469:9667:704c with SMTP id t11-20020a056402240b00b004699667704cmr5024288eda.318.1670398611832; Tue, 06 Dec 2022 23:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670398611; cv=none; d=google.com; s=arc-20160816; b=wC7f5nphSjUuHa23sKL0E51sjr3cpeG6QaQCuVUZGfK8g4NgRsjZRRA/typi1QbUGv GjXuKjy+XDpcU/Nz+ka17YoABIkiuLRVnKqcAWOPB2VP1eElPniRHRpYPFLSd8o00IUt hGnW6zqMP4myXHlzSF6fJfrRe9ijNJGQzb13rRk2w9sL7ODFHqb3KpRENM3+W+G2sDJ0 8GFUO2cPaXqkufrqbGm/tITV1afL2e74Um830jWhQsLQje9645WX39wBMTI5jJaw/cob D0bAaRVmN9zch5lTzKeTL294QzPuZABo7TObtlfdJVShqGxRrPBcSo3btmM4ZdVlu4v1 MFzw== 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=zdJCg5ZKVA54xXZ3MMNip2V4q7Gr7tSKkVk18qXzj7k=; b=gCENEH4v7I3we8Y9D9MURWDkoE2YojA6Txt96a5oxJHtTIXhk37nTAiKElDGifYqoI yD5K1Ka0GYjyQvwUXpwA6iEXuf7+Ajf2Tan8eWlSlNzQVFBdS0h3IZTnPJR0f5CmfANa nqSO8kMoi6YPPM8JElJkLM25XJVzP9ONkqDqOdxVC41QWLgom4TIpYBPrwGIJVUkj8zk XbsxV32KxXKammi34PhBZ6hQ4Lj5iE3IKMNEqUFeeyRVJ9WPsKUKodUDhdc2NMvZMWkv UdfyjtTKvFkZ7tRZ0QbifmQQrqnYGSfrd8fAIrzXGbsldElV7OLxoOf4dFs5SJ8HCJMN VLeQ== 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 k14-20020a170906a38e00b007c0d7aca43esi7245822ejz.974.2022.12.06.23.36.27; Tue, 06 Dec 2022 23:36:51 -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 S229600AbiLGHcm (ORCPT + 99 others); Wed, 7 Dec 2022 02:32:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiLGHcf (ORCPT ); Wed, 7 Dec 2022 02:32:35 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256F9BA5; Tue, 6 Dec 2022 23:32:33 -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 4NRpsC68D9z4xVng; Wed, 7 Dec 2022 15:32:31 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2B77WOZ0050816; Wed, 7 Dec 2022 15:32:24 +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:32:27 +0800 (CST) Date: Wed, 7 Dec 2022 15:32:27 +0800 (CST) X-Zmail-TransId: 2af96390418b25a70f55 X-Mailer: Zmail v1.0 Message-ID: <202212071532270902318@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?utf-8?q?=5BPATCH=5D_iio=3A_adc=3A_adi-axi-adc=3A_Convert_to_use_s?= =?utf-8?q?ysfs=5Femit=5Fat=28=29_API?= X-MAIL: mse-fl1.zte.com.cn 2B77WOZ0050816 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 6390418F.000 by FangMail milter! X-FangMail-Envelope: 1670398351/4NRpsC68D9z4xVng/6390418F.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6390418F.000/4NRpsC68D9z4xVng 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?1751539894447075481?= X-GMAIL-MSGID: =?utf-8?q?1751539894447075481?= 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/adc/adi-axi-adc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c index e8a8ea4140f1..20a6e7463552 100644 --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -240,8 +240,7 @@ static ssize_t in_voltage_scale_available_show(struct device *dev, for (i = 0; i < conv->chip_info->num_scales; i++) { const unsigned int *s = conv->chip_info->scale_table[i]; - len += scnprintf(buf + len, PAGE_SIZE - len, - "%u.%06u ", s[0], s[1]); + len += sysfs_emit_at(buf, len, "%u.%06u ", s[0], s[1]); } buf[len - 1] = '\n';