Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp733993rwb; Thu, 8 Dec 2022 02:10:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5r5pe32iHXY9TvbHVeS+Vtt0ePGQuy6GRwqLzDM0Weqm8NnRLgV6ssbdMNByda2org4ZWE X-Received: by 2002:a17:906:1585:b0:7ad:84c7:502d with SMTP id k5-20020a170906158500b007ad84c7502dmr64311384ejd.177.1670494225781; Thu, 08 Dec 2022 02:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670494225; cv=none; d=google.com; s=arc-20160816; b=tVUQLeC/EaVcMzdqyvzjVpPVAMwniyncSKXQB9OtduPag46mt2Io3fCqQLmOeFg3bk uJ/zqL/PelFktdzeKP9Uc5JrPw7zh7MA7XymV7dHaLH4JksKsdVkxGertEd/fvHzxE5J bm2+Fs7lfe03Z6rAcw8Z0QxEmawM7NYF5jj24exIJRMBtHPDgn5+rRPMlKUuAbItLElF 5LniawJJvwxsXfHV97oZIMYr17sZOox40Pnbpc+5UNO4nbtmJDZF+TvNsgk83HTQ3v9e 0IFtRUP1GCufnM5pRGvqGhUcNx90YSVq/xtt0LRBk9Uyd6vUnzaZDwKPpLkJX7AYwnNo qzDg== 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=dgIWvX+MkjSAQ2FzAJCKifK4nslUU3Rc94ivgDNMlIo=; b=m3j0z9AEp10WtUAMYneUboqVy0ONzNSOYFkwnl/1gN5Ix+ppZB3KqLX/rVbXVoMUQZ lPuzGG1DMdpYnqprTsQeQEQ09mP+8ME5tAur4HPffjsbPZEhfH/1GCrsQxouxl8e6/wb DVwgIn3RqdPrD7KHjd47rnIv2+JCS9VFfb3bi/WD6FKjLwHFXLkdhbHrigF0IeFKlTUd 2lQiNnO/etLyrFa7iIZCP18w8ytp7vwZ1yv2tDRxTknyqgPm6dGx5lAbGzH7pExcKVFP zKX3pn6bAKyCzvuHMNK0nKXcmfeIh4pLSBFXclImzwTwDpezIxqxUcmencQ54gLKyIY8 WfNg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tl6-20020a170907c30600b007ad943d0608si13671438ejc.630.2022.12.08.02.10.08; Thu, 08 Dec 2022 02:10:25 -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 S230180AbiLHJHx (ORCPT + 72 others); Thu, 8 Dec 2022 04:07:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbiLHJHT (ORCPT ); Thu, 8 Dec 2022 04:07:19 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29FB86D7DA; Thu, 8 Dec 2022 01:06: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 mxct.zte.com.cn (FangMail) with ESMTPS id 4NSSvC2GbRz4y0vL; Thu, 8 Dec 2022 17:06:31 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.40.52]) by mse-fl1.zte.com.cn with SMTP id 2B896QIo053511; Thu, 8 Dec 2022 17:06:26 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 8 Dec 2022 17:06:29 +0800 (CST) Date: Thu, 8 Dec 2022 17:06:29 +0800 (CST) X-Zmail-TransId: 2af96391a9151619e636 X-Mailer: Zmail v1.0 Message-ID: <202212081706290141979@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?UTF-8?B?W1BBVENIXSB0aGVybWFsOiBDb252ZXJ0IHRvIHVzZSBzeXNmc19lbWl0X2F0KCkgQVBJ?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2B896QIo053511 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 6391A917.000 by FangMail milter! X-FangMail-Envelope: 1670490391/4NSSvC2GbRz4y0vL/6391A917.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6391A917.000/4NSSvC2GbRz4y0vL 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 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/thermal/thermal_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index f17ab2316dbd..91d40ce62c92 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf) mutex_lock(&thermal_governor_lock); list_for_each_entry(pos, &thermal_governor_list, governor_list) { - count += scnprintf(buf + count, PAGE_SIZE - count, "%s ", - pos->name); + count += sysfs_emit_at(buf, count, "%s ", pos->name); } - count += scnprintf(buf + count, PAGE_SIZE - count, "\n"); + count += sysfs_emit_at(buf, count, "\n"); mutex_unlock(&thermal_governor_lock); -- 2.25.1