From patchwork Wed Dec 7 08:44:17 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: 30712 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp63793wrr; Wed, 7 Dec 2022 00:59:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TJPKljJVojN1y2hOT/ejIJdapQi9AziWjUgGCdz6EVNbalOi046h4u3vLl3NT0VUZAbO8 X-Received: by 2002:a17:906:5409:b0:7b2:7b45:848f with SMTP id q9-20020a170906540900b007b27b45848fmr77358783ejo.129.1670403552224; Wed, 07 Dec 2022 00:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670403552; cv=none; d=google.com; s=arc-20160816; b=Uhy+3MTiEHu1VaadGyXclzSw9Y4ExXSQS5JiQk495X9gabCfOscF/WzhcjAkWG5lnm kUAptdfFNvcjjlD4auVYMewa0Mg1+xwTpm6lzPF8Cg8zFWEeVZGsq/7M0dNdakq9K7Jp JNC7BdbRrlCdX8PnSijXSSf54RRcfVYdV/MmscljsQLoCbYAcYH6tFl8djIENL2JOyAz 8pfJKfmq4+V79VUZbHdyrCnBxsFCVG3y8tF6W+JL3QWEk8YHJaoIJ2fDAJaxs3+NxsuK MmzAIWpb3BGUZ12clrthOwN1L7VchBLULTrLPaj5SesdoQRZZeuTaumV2LcwWdb8HX21 xcxA== 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=OF89IvUVstEjjO+Ol0Xs3ksiWx74gDQ6Of3n4NKCyU8=; b=ckHc7C6VxsanZ7be13asdUOrngKGOpDbbQQcvlKrFilcoKL32UC9MHigsow1pTo3mp HtAHcYr9L7UwgSQ61vB2BoQbKA1d+SVHDmBb2L1aR+umhZeWUuFl+J/wA3zoQjk3rtmF 7pBTk0n+91eAwPJ6b7j6c3vqOMjZ+OI2k+CukEFzut6oTPOtN4puiHh14w3XH9aTZD5V bRGXcZxTIX8lBdpmnoORR7IVeGcyDGmPjQVjKfEh2yKfIeXVgoIcH6/MF2lPIaAqQsN2 lihTqfLsKYxSuLYWuVZJ/ojClqBEJLfSZTXimuJ9LWz086Gx/TbbYKHP5wrxCnfIZ0sf wHIA== 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 r24-20020aa7c158000000b0046ca3c3df50si3667831edp.211.2022.12.07.00.58.49; Wed, 07 Dec 2022 00:59:12 -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 S230095AbiLGIq0 (ORCPT + 99 others); Wed, 7 Dec 2022 03:46:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbiLGIow (ORCPT ); Wed, 7 Dec 2022 03:44:52 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB1AE326FF; Wed, 7 Dec 2022 00:44:28 -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 4NRrSB5GZ7z8RV6M; Wed, 7 Dec 2022 16:44:26 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.40.52]) by mse-fl1.zte.com.cn with SMTP id 2B78iEVJ043223; Wed, 7 Dec 2022 16:44:14 +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 16:44:17 +0800 (CST) Date: Wed, 7 Dec 2022 16:44:17 +0800 (CST) X-Zmail-TransId: 2af96390526103d06ca3 X-Mailer: Zmail v1.0 Message-ID: <202212071644171074630@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH=5D_Input=3A_Convert_to_use_sysfs=5Femit=5Fat=28?= =?utf-8?q?=29_API?= X-MAIL: mse-fl1.zte.com.cn 2B78iEVJ043223 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 6390526A.001 by FangMail milter! X-FangMail-Envelope: 1670402666/4NRrSB5GZ7z8RV6M/6390526A.001/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6390526A.001/4NRrSB5GZ7z8RV6M 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?1751545074775848482?= X-GMAIL-MSGID: =?utf-8?q?1751545074775848482?= 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/input/vivaldi-fmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/vivaldi-fmap.c b/drivers/input/vivaldi-fmap.c index 6dae83d96806..ac5edc4d2ab0 100644 --- a/drivers/input/vivaldi-fmap.c +++ b/drivers/input/vivaldi-fmap.c @@ -27,10 +27,9 @@ ssize_t vivaldi_function_row_physmap_show(const struct vivaldi_data *data, return 0; for (i = 0; i < data->num_function_row_keys; i++) - size += scnprintf(buf + size, PAGE_SIZE - size, - "%s%02X", size ? " " : "", physmap[i]); + size += sysfs_emit_at(buf, size, "%s%02X", size ? " " : "", physmap[i]); if (size) - size += scnprintf(buf + size, PAGE_SIZE - size, "\n"); + size += sysfs_emit_at(buf, size, "\n"); return size; }