Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2013125rwb; Wed, 30 Nov 2022 00:45:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CJT5LTmX7BIf/5R+sLr+QbrW4cbMRr1XtIWusqNQtUxHEDLYCX1SGvuCB0oHMzy87svUT X-Received: by 2002:a17:906:144c:b0:7ad:cda3:93c7 with SMTP id q12-20020a170906144c00b007adcda393c7mr51981856ejc.500.1669797911551; Wed, 30 Nov 2022 00:45:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669797911; cv=none; d=google.com; s=arc-20160816; b=SDIbHJgXADBG9Bzs8UdQ1EJf2Yym7/Zc4HfUWKZilT22elnbRP1pB0Pxm4RbrhwYSz +Wj9PjbGQyFfWf7d8IRRl7r8jyiUIFdeMVjsVpU0FyKCCj352mPMc5ZP9GSA/EZihjdd xMkRwMWqYFWpPIQx+0MM6K3Ht5s36jglrBoUhUWmHH7wXTol6ertvSDsOlUNsZkqTavY WbifBfPv51U/9QQuzhxPEohC83gAyLhCl9Q/4q0/gmQDqDRylhHJ26RBuBM0dO4NX3As fETyqxxiAL5af+YjlhRMs11XAkYFzSUki3jTSgcygR/XF57zN4KvxFjnBgvU81hy/O2H kuRQ== 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=dpFkK3CdM/AgxruDHrHIcWmTsfyO2o6QWMKawWc84OY=; b=TRllqI0/e9gulIXT3YYQUnMeDrTILfabwP4ltFGA2C0GLIa0tTZyCuU6oAqMBZtlF7 jEyqVjiurOu+albdEFFyErUSzD44JhuM9Ody3mYCEsRyDxoTfDm6xO8iUEXfHn7Rmksu 6tSdTO8ihWwsW/SbgynCbmDY4+52jnjxSegay8ZXrnQJ2r62JLHsDepmBgzarfEzAb8d /tT7N1xakDaC9WWrlWwiR5aWnCuFZ7c2yyZ6fPEvCEYtmHeB7ppdHL91FdvjkNjVEG7y ox1UH/c1LxNwPw6s9Sb+PNYXQQrix91U8HJtTtIL/UsBnuT1BnGQzK1ip4cpJQm/6QIN 9DmA== 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 a13-20020a170906684d00b007c080a6b4d5si650556ejs.428.2022.11.30.00.44.50; Wed, 30 Nov 2022 00:45:11 -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 S233639AbiK3IQV (ORCPT + 85 others); Wed, 30 Nov 2022 03:16:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232758AbiK3IQT (ORCPT ); Wed, 30 Nov 2022 03:16:19 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 115D44FFB8; Wed, 30 Nov 2022 00:16:18 -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 4NMX8w4bkZz8RV7G; Wed, 30 Nov 2022 16:16:16 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AU8G6MD040533; Wed, 30 Nov 2022 16:16:06 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 30 Nov 2022 16:16:08 +0800 (CST) Date: Wed, 30 Nov 2022 16:16:08 +0800 (CST) X-Zmail-TransId: 2af963871148fffffffff8d9463e X-Mailer: Zmail v1.0 Message-ID: <202211301616083499042@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?UTF-8?B?W1BBVENIIHYyXSBBQ1BJOiB1c2Ugc3lzZnNfZW1pdCgpIHRvIGluc3RlYWQgb2Ygc2NucHJpbnRmKCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AU8G6MD040533 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63871150.000 by FangMail milter! X-FangMail-Envelope: 1669796176/4NMX8w4bkZz8RV7G/63871150.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63871150.000/4NMX8w4bkZz8RV7G 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 From: ye xingchen Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen --- v1 -> v2 combine patchs in drivers/acpi/. drivers/acpi/acpi_pad.c | 4 ++-- drivers/acpi/cppc_acpi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index edbb28faee2a..02f1a1b1143c 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -287,7 +287,7 @@ static ssize_t rrtime_store(struct device *dev, static ssize_t rrtime_show(struct device *dev, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time); + return sysfs_emit(buf, "%d\n", round_robin_time); } static DEVICE_ATTR_RW(rrtime); @@ -309,7 +309,7 @@ static ssize_t idlepct_store(struct device *dev, static ssize_t idlepct_show(struct device *dev, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct); + return sysfs_emit(buf, "%d\n", idle_pct); } static DEVICE_ATTR_RW(idlepct); diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 093675b1a1ff..0f17b1c32718 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -148,7 +148,7 @@ __ATTR(_name, 0444, show_##_name, NULL) if (ret) \ return ret; \ \ - return scnprintf(buf, PAGE_SIZE, "%llu\n", \ + return sysfs_emit(buf, "%llu\n", \ (u64)st_name.member_name); \ } \ define_one_cppc_ro(member_name) @@ -174,7 +174,7 @@ static ssize_t show_feedback_ctrs(struct kobject *kobj, if (ret) return ret; - return scnprintf(buf, PAGE_SIZE, "ref:%llu del:%llu\n", + return sysfs_emit(buf, "ref:%llu del:%llu\n", fb_ctrs.reference, fb_ctrs.delivered); } define_one_cppc_ro(feedback_ctrs); -- 2.25.1