From patchwork Thu Nov 17 01:34:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: guo.ziliang@zte.com.cn X-Patchwork-Id: 21373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp160922wrr; Wed, 16 Nov 2022 17:40:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Js2Zn2uiqjWdeCNJfy+dWNl3F7AZvBfNCIpYuVNHGg3gqXIWUSItQbrYA7pWSLw34sdzy X-Received: by 2002:a17:902:6b41:b0:186:f1b6:c3dd with SMTP id g1-20020a1709026b4100b00186f1b6c3ddmr628600plt.20.1668649257506; Wed, 16 Nov 2022 17:40:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668649257; cv=none; d=google.com; s=arc-20160816; b=dARtqNlYrCGmC+UUoUBNm81259fYtb+h153mBTWmOBOnA7H3NPxM/dotQaxDUejj7U zqGHO2wMa01bykWxTDS4UuJB8/hIb2cX7qmftY5OpFkcQoCji5xd89gMfDr7zXbh3D+x rA7dbPYa0I+GvZnLwGlDD195saIcr9oyUmJQ1sWRdFozdNY6D/vdYH8YyHEtCAwXgaxo 0mlMYF8J+WMRFVtHU+6M11H5cu3DCmD3Wx+/LrARN5dPTLVx2j+/+/V7PwwR55pEp752 Etn067qIOLQhxors2NBIrpo37raM0tc9AxTWydQ05hnv/+kveOmcR16sT5jvP1O9rZSN YrCQ== 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=rnIcPcwRaoJZTwjF7jq/fp5u5WDisGORAGJFlC4iJ/0=; b=Xvno4nhM9fu4Urd28dk02muXAF4zzYC8zU4K59Ih9odoCI/CtUJ3ZA39vjxjGbNwUe Ofd8sPoXFoUstzSEHs2PieGg8fMZgpi2KNo9HRTdBBI1O3WTlEOXJl1ZWlWtkbizQW/s O2BjHOY8SjyKMB8f3o2A/FTWw0aBqVtP8zUWKm+npxrBl39yA2vuRqlzn2K31Qxwc3+h 33xZ/6dMk2ENA9A4oSnait4nG1V2ZP6pDj8igqi7/+fOd2/QV6A1mSUr7XaMonT8dr7+ 6DSAC8P3EWQyACooK7OYDm9clisRtdNAYOuIPf36MBVPVYXXcnTPsqEsIBcYvyZ4FIhp kEiQ== 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 jj18-20020a170903049200b001870464adb6si14792752plb.183.2022.11.16.17.40.44; Wed, 16 Nov 2022 17:40:57 -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 S234775AbiKQBeU (ORCPT + 99 others); Wed, 16 Nov 2022 20:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234444AbiKQBeS (ORCPT ); Wed, 16 Nov 2022 20:34:18 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 476F51DDF9; Wed, 16 Nov 2022 17:34:17 -0800 (PST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NCMs25BWqz4xVnD; Thu, 17 Nov 2022 09:34:14 +0800 (CST) 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 mxct.zte.com.cn (FangMail) with ESMTPS id 4NCMry6TYlz4y3ZB; Thu, 17 Nov 2022 09:34:10 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH1XxdK072447; Thu, 17 Nov 2022 09:33:59 +0800 (+08) (envelope-from guo.ziliang@zte.com.cn) Received: from mapi (xaxapp03[null]) by mapi (Zmail) with MAPI id mid32; Thu, 17 Nov 2022 09:34:00 +0800 (CST) Date: Thu, 17 Nov 2022 09:34:00 +0800 (CST) X-Zmail-TransId: 2afb63758f887390f199 X-Mailer: Zmail v1.0 Message-ID: <202211170934005278113@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_ACPI=3A_sysfs=3A_use_sysfs=5Femit?= =?utf-8?q?=28=29_to_instead_of_scnprintf=28=29?= X-MAIL: mse-fl2.zte.com.cn 2AH1XxdK072447 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63758F96.002 by FangMail milter! X-FangMail-Envelope: 1668648854/4NCMs25BWqz4xVnD/63758F96.002/192.168.251.13/[192.168.251.13]/mxct.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63758F96.002/4NCMs25BWqz4xVnD 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749705564011023257?= X-GMAIL-MSGID: =?utf-8?q?1749705564011023257?= From: guo ziliang Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: guo ziliang --- drivers/acpi/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3.1 diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 2d81c74..7db3b53 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -198,7 +198,7 @@ static int param_set_trace_method_name(const char *val, static int param_get_trace_method_name(char *buffer, const struct kernel_param *kp) { - return scnprintf(buffer, PAGE_SIZE, "%s\n", acpi_gbl_trace_method_name); + return sysfs_emit(buffer, "%s\n", acpi_gbl_trace_method_name); } static const struct kernel_param_ops param_ops_trace_method = {