From patchwork Wed Nov 9 13:25:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 17540 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp336899wru; Wed, 9 Nov 2022 05:36:17 -0800 (PST) X-Google-Smtp-Source: AMsMyM7W0A61xGTU0nxpqLDVUvjZDO5pYBSvj1SD/ME4BRPI6PweouK8Pn/4xZvd/7XuiZB8iT7l X-Received: by 2002:a63:cf48:0:b0:439:7d1c:fedc with SMTP id b8-20020a63cf48000000b004397d1cfedcmr52125806pgj.281.1668000976927; Wed, 09 Nov 2022 05:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668000976; cv=none; d=google.com; s=arc-20160816; b=NIa/HpR/cXBt3n85iHHubU2k96J2BRX82DgJLP40J7A0WKuw6UeL8Qjp8uBlNqhxFy /e9Wg6dMAJPR+G7Q0Alav1I5u5GA0U0jxJ3ryaow6Io0ChzI/b9GDdwKbfyyxkOJ/VVv IWNYukjnJv8YsIUc5/8YGja0FXKt1h+Kgg9aKHpvKo7ObqOtOSBOAmppTNvogMfhlCrt WwXD5F4I2N4yi3GXvdGyvr9WCUSw5n9n2Gq2NtooCgZkMYci1uUn+Qg3iqc74TS9mXQp GaUCS2WXdRJS7qJ5XB+i0O1KnG9eDLiS8fxhlSw6MSFdJPz1uUh5azq8reUSf3L7vSdx /KsQ== 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=zsf9tSB1t2A7ygTdoYjmbV7xtjh9SvHn9asoAPyRz3s=; b=PaUQKQ+eEgx9fpKqNFB8wIwyjfFbAJuh4zFH5gQDo2PPGUdodLfH6WhdTeNUxIpFqc kGDjYK2sRr5HDjPGM3plZ31udNODTgS+8kzTlm34p7Z4kiBf4jlOesgCPCmzcEyPRFr4 oFdDtkUZOI/p2tiOHgx1H3ADePFE4OWZUpvpp+IEHetPU3Z623xmbY2FHTR7LEz1gvL6 ffeqhJMkbThcWD8/NU5QGUgOtVleH6eLe34xMgO1qfkmG+cOJ3Xr2FkHZphIXB19KzpT e0SVltkuiPFaB2y0VOcfi9VtMLQ4IEjLeQxu+ZYqIsXgAOfX0gq0X8Q+xCx869WEp3N7 16yQ== 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 h13-20020a63f90d000000b00439ae523fd2si18299637pgi.289.2022.11.09.05.36.02; Wed, 09 Nov 2022 05:36:16 -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 S230038AbiKINZe (ORCPT + 99 others); Wed, 9 Nov 2022 08:25:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiKINZb (ORCPT ); Wed, 9 Nov 2022 08:25:31 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9A82EF12 for ; Wed, 9 Nov 2022 05:25:30 -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 mxct.zte.com.cn (FangMail) with ESMTPS id 4N6m1N1MFPz4y0vN; Wed, 9 Nov 2022 21:25:28 +0800 (CST) Received: from szxlzmapp04.zte.com.cn ([10.5.231.166]) by mse-fl2.zte.com.cn with SMTP id 2A9DPLPo095556; Wed, 9 Nov 2022 21:25:21 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp03[null]) by mapi (Zmail) with MAPI id mid14; Wed, 9 Nov 2022 21:25:25 +0800 (CST) Date: Wed, 9 Nov 2022 21:25:25 +0800 (CST) X-Zmail-TransId: 2b05636baa4532d1ea80 X-Mailer: Zmail v1.0 Message-ID: <202211092125250606392@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 2A9DPLPo095556 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 636BAA48.000 by FangMail milter! X-FangMail-Envelope: 1668000328/4N6m1N1MFPz4y0vN/636BAA48.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 636BAA48.000/4N6m1N1MFPz4y0vN 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?1749025792723674091?= X-GMAIL-MSGID: =?utf-8?q?1749025792723674091?= From: Xu Panda Replace scnprintf() with sysfs_emit() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/acpi/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 2d81c742e4d2..e6fe1c02a138 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 = {