From patchwork Wed Dec 7 02:48:33 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: 30607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3177162wrr; Tue, 6 Dec 2022 18:54:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qguLeeL043Q6c7W6BZQcPQyWlWSvgZrqwLK9/AhXpK/v8x1UvixFEMkcjBvVu73dC3YcS X-Received: by 2002:a05:6402:2949:b0:468:fb6b:3a79 with SMTP id ed9-20020a056402294900b00468fb6b3a79mr22433216edb.63.1670381683009; Tue, 06 Dec 2022 18:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670381683; cv=none; d=google.com; s=arc-20160816; b=iw/J2fC63N8IEF+5UrC/+xlZy0NvDmK72jGlfOs+hfdZCWaAFi7gQNPAZrDTXoGrWr YDSW67wi91MOEQmcCVsqKtR+DHoRrhuxhuny8sjPEYtSdSYRwA0LdVo2SyEE4gVQKhw0 /06ai0u/EDvIdUnH+v8Bd/rKD2vnAf0rciRtQyT1WLsf2m1OFNdwZzE/HRozrqGH/3CZ 8s4jMh4wgsqXMa8jO/OAw3g5nG8kI1YphfTSNpC2wZ8WrtPkN0fjS7ttW0aR7Vajudbv i/gxKgfnIgfoRYkiFH9V5vdy1tDLjJybRq/SrMPVayfOs7uDrmsjbAT/rgQFCxCel+P1 hrVg== 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=wCip2L0X1/21ywBbVvQkiyORKM7RtJjVs25+bAM1Q3w=; b=a898aY/z0H3PEEXzQqY2g1dxnqVYx8wnu9jo/y7L7fS8J1+B8zopwRUf65L8bImtZW NdVPqfIiTO+Iqo7xdI6XMIBuQp5w2GVdcYMbX2EV1RUnPW7EbgQYD208ddcamvL+2gQI rC85nZhWtVlKPkyWcdpAHN57gixOJGJjOfHAy30s7SFS972Pv1SDyucj/LZma5SLf6S0 XT+DzjyjVkubWyikNgrpGkfxLjd1wqWhZuTnQ/n1kmeeHMruFKFOXwaIIz+SM9HlciWE TJSGqa3ZD0wc2oC/82vTmjL9lx6OcuKfBc842cnjOUHue23jbKOQ5SBDLSP4zWDTOAj+ 6dJA== 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 hv12-20020a17090760cc00b007baa6e22742si17432107ejc.570.2022.12.06.18.54.19; Tue, 06 Dec 2022 18:54:42 -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 S229811AbiLGCtJ (ORCPT + 99 others); Tue, 6 Dec 2022 21:49:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiLGCtE (ORCPT ); Tue, 6 Dec 2022 21:49:04 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7BD2CDC8; Tue, 6 Dec 2022 18:48:48 -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 4NRhYp3gQYz8R047; Wed, 7 Dec 2022 10:48:46 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.40.52]) by mse-fl2.zte.com.cn with SMTP id 2B72mW7C087314; Wed, 7 Dec 2022 10:48:33 +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:48:33 +0800 (CST) Date: Wed, 7 Dec 2022 10:48:33 +0800 (CST) X-Zmail-TransId: 2af9638fff01ffffffffa7b71974 X-Mailer: Zmail v1.0 Message-ID: <202212071048339386860@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH_v2=5D_i2c=3A_mux=3A_Convert_to_use_sysfs=5Femit?= =?utf-8?q?=5Fat=28=29_API?= X-MAIL: mse-fl2.zte.com.cn 2B72mW7C087314 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 638FFF0E.001 by FangMail milter! X-FangMail-Envelope: 1670381326/4NRhYp3gQYz8R047/638FFF0E.001/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638FFF0E.001/4NRhYp3gQYz8R047 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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?1751522143774413372?= X-GMAIL-MSGID: =?utf-8?q?1751522143774413372?= 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 Tested-by: Wolfram Sang --- v1 -> v2 Fix the code style. drivers/i2c/muxes/i2c-demux-pinctrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c index f7a7405d4350..28e0911920be 100644 --- a/drivers/i2c/muxes/i2c-demux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c @@ -167,9 +167,9 @@ static ssize_t available_masters_show(struct device *dev, int count = 0, i; for (i = 0; i < priv->num_chan && count < PAGE_SIZE; i++) - count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%pOF%c", - i, priv->chan[i].parent_np, - i == priv->num_chan - 1 ? '\n' : ' '); + count += sysfs_emit_at(buf, count, "%d:%pOF%c", + i, priv->chan[i].parent_np, + i == priv->num_chan - 1 ? '\n' : ' '); return count; }