From patchwork Tue Jan 17 02:42:17 2023 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: 44471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1525749wrn; Mon, 16 Jan 2023 18:57:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXvo/6aNyGb/c3DQFlNyIlC4SFJMc8Y6jEHjd0uSCGSIUl6q2F9mrwruBBu1UshhlxfhAiuJ X-Received: by 2002:a17:902:ee82:b0:193:30bc:ed86 with SMTP id a2-20020a170902ee8200b0019330bced86mr23965757pld.48.1673924271804; Mon, 16 Jan 2023 18:57:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673924271; cv=none; d=google.com; s=arc-20160816; b=t6BJ30toqTd/D8mjpBSEzwVjEi7YbKR2SOvErt17uP20QofxpJSMcJn71KqMmZZ4Yk jBqLYA2IwwgZ2yW730EAYFwNfkyXU0vEt7nQKTWrbc4tuSy7iJRgeV7GkfLIJ5IpBxYr kcolb+M0qAcoDfGKTI4FGpe6zNIPz16lFT/dUGi5DlVvCH7LGDvjYMbxLICcry1TPWiF 85p54DxEs3HLssMk4TAsazW1ELSb6tQpcHiUpWmXOZsnAj5IDry6MfzxUSZf+KYo+3NW CpIyp9xjhqIB56VsIuiRL2CEDdJZvlh8SQcyj44VSamqZbl4ywRMUbPS2oFZdRCI9e0n kmGQ== 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=RjZRI7F8PDhLrZn72yfx9mtV3Wc5sTgM5ZZOXLjA3bU=; b=jcEfGCkDNDlA1/SU2TA1K2Agep2Bun4b6AmtAoOvLl0kraw4YVyRj1htdzolgOWK7v eKdT6GrCPiFWxWD7MJPpGygbY8DJJcfvWoFfGb9SD+FshfcoJ0m1ersSNY/kkZ5ab3EH 8cyOX92KZGNodmcBjkBvAgvuaFiNcLUyzi0/IgLf5oTHbGldGnrMlzhF91zUQCqAiRXd ItKaDygCnh4KkwPY2YJCOb0QGG8wLAkzH6iN0qO9u1gOVvTssfexVrqJboOq4g2uhD2N Bn7Uw3LYgFhkgcIyXC7i+P0qA1NpFFXnazwa0zEJ3oIBGyBDG5ovaESv3GpmwLBYbubM wJdQ== 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 w191-20020a6382c8000000b004cbb361aafcsi7696098pgd.155.2023.01.16.18.57.39; Mon, 16 Jan 2023 18:57: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 S235587AbjAQCuW (ORCPT + 99 others); Mon, 16 Jan 2023 21:50:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235704AbjAQCt4 (ORCPT ); Mon, 16 Jan 2023 21:49:56 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AC5B33463; Mon, 16 Jan 2023 18:43:03 -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 4NwtTV5mHYz501TL; Tue, 17 Jan 2023 10:42:22 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl1.zte.com.cn with SMTP id 30H2gFa3047682; Tue, 17 Jan 2023 10:42:15 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Tue, 17 Jan 2023 10:42:17 +0800 (CST) Date: Tue, 17 Jan 2023 10:42:17 +0800 (CST) X-Zmail-TransId: 2af963c60b09602345dd X-Mailer: Zmail v1.0 Message-ID: <202301171042170334662@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , Subject: =?utf-8?q?=5BPATCH=5D_thermal/int340x=5Fthermal=3A_Convert_to_use_s?= =?utf-8?q?ysfs=5Femit=5Fat=28=29_API?= X-MAIL: mse-fl1.zte.com.cn 30H2gFa3047682 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C60B0E.000/4NwtTV5mHYz501TL X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR,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?1755236817154094414?= X-GMAIL-MSGID: =?utf-8?q?1755236817154094414?= 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 --- .../thermal/intel/int340x_thermal/int3400_thermal.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index db8a6f63657d..c1fc4a78607c 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -130,10 +130,7 @@ static ssize_t available_uuids_show(struct device *dev, for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) { if (priv->uuid_bitmap & (1 << i)) - length += scnprintf(&buf[length], - PAGE_SIZE - length, - "%s\n", - int3400_thermal_uuids[i]); + length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]); } return length; @@ -151,10 +148,7 @@ static ssize_t current_uuid_show(struct device *dev, for (i = 0; i <= INT3400_THERMAL_CRITICAL; i++) { if (priv->os_uuid_mask & BIT(i)) - length += scnprintf(&buf[length], - PAGE_SIZE - length, - "%s\n", - int3400_thermal_uuids[i]); + length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]); } if (length)