Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1153385rwb; Thu, 10 Nov 2022 11:57:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf5E6wAzZ67prL7RPywiqjLN6B3u6iswYPvwEuUvjN0Gjy3eOaUKnzmlqoekhRqfxY5ec23t X-Received: by 2002:a17:906:c343:b0:7ae:ab69:67b5 with SMTP id ci3-20020a170906c34300b007aeab6967b5mr1630461ejb.577.1668110227192; Thu, 10 Nov 2022 11:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668110227; cv=none; d=google.com; s=arc-20160816; b=IY653NK4EM91truiqLHcf1o217hiAXGLN0onwGTWnsMHXG5q9v1e8eCS8mDHoPPNx3 neB0EZUk503ElTb/Vjt32j6TAyO7BvyZpiIConvYitRUixeWfGGcOYq5R37/wXH5bG96 rKeEtKaWtYNWK8i8y2FHpq3lbwW8oTZiNJaWbWfnhxVUXJKV/QuOjxqUN6ABTGOIuY9S GqWARD2hOhep/Q7YmwOUINi23vnqJbW2t20Q4T8fsEpyeFZv70lMy/azdauqAfKHMwOZ Qbz2NfdFneY1FFs4k6n+EO84w3Ij96lwrrO3UoHUmR2goBI5og1VPjh4ATFOw56mEMxs iRyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=RdILW2TfdSLcvwmccYyLpd9PEgHcqApl5ASbOnvFyLQ=; b=a78ikdkkSfQVmOTFGTWaecEGQZGFqAeNhHvRyfHTMolZwSZTo/y2eAQP0h0OoV5G/0 CFWyBjYjX07UF12s8NVDPJSS0Z2tDlRRJQ3BQ8dGOpJkAwxdxDtiFsI4h2etMzsZgXzh 0r9nB9ocrU6IPxzwOorD/QNH/0M0FD0cuQkTlJW4QP+8876gSEyvVimcmHISfopuAFK4 v8N0Yg5e60OJtsLLxidDG3Qc+y/5qfcRDndQyVu88KNqe9HRiDk9mOkRhsxkqQD1VhWS Y7nUEI0kBeLTj3a//YE0o7iCaUrcs4QGU81guDp4xwbfOYshLarEIIGIvnn/nRL2U15W WLbw== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p27-20020a1709066a9b00b00781e6ba94ffsi173113ejr.126.2022.11.10.11.56.44; Thu, 10 Nov 2022 11:57:07 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiKJT0T (ORCPT + 93 others); Thu, 10 Nov 2022 14:26:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiKJT0R (ORCPT ); Thu, 10 Nov 2022 14:26:17 -0500 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57372ED56; Thu, 10 Nov 2022 11:26:16 -0800 (PST) Received: by mail-qt1-f171.google.com with SMTP id cg5so1530696qtb.12; Thu, 10 Nov 2022 11:26:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RdILW2TfdSLcvwmccYyLpd9PEgHcqApl5ASbOnvFyLQ=; b=hPjk1U5q5+hKduPsTTZewAYTO7VjuuiLqy1ITGGEIPD66w5ik1JS9eLrW0XlPZ6Xgv uca7VjhWSNfudy+hcX3tsU3xuI2aUwBlj6VaMHXyMCNdtreXUzvPT/5JuewQAcYIqTxX egcyQz3GPnEhgSZw4fotg+hKetxwlJTzJzl5fwYwSL6haNW6fhwvo/+MnphJJcuGI+mb w/8XNFz+G8zuFB89Z3HrEVqpJ4Fh+5XS/i+HLvV+htMOoIw4hc/gH1Q23Z8loU4Mp8JR HzJVNgzojRFO8xW3MSkQQkcpOcZZTce+dOvyVJ3gixd5leLXoxqyJQEYskGJT8uG9TgC AR7Q== X-Gm-Message-State: ACrzQf0CO4X/zpN6wYbSP7RzqDg969ycq0M+JDr8LfKY2ckNdagPiIu/ kbj+MQVoMPaUpq3TE5bBWR3XDaOWfLihMPJUQXs= X-Received: by 2002:ac8:690f:0:b0:3a5:4678:5b24 with SMTP id bt15-20020ac8690f000000b003a546785b24mr1513773qtb.411.1668108375937; Thu, 10 Nov 2022 11:26:15 -0800 (PST) MIME-Version: 1.0 References: <202211092125250606392@zte.com.cn> In-Reply-To: <202211092125250606392@zte.com.cn> From: "Rafael J. Wysocki" Date: Thu, 10 Nov 2022 20:26:05 +0100 Message-ID: Subject: Re: [PATCH linux-next] ACPI: sysfs: use sysfs_emit() to instead of scnprintf() To: yang.yang29@zte.com.cn Cc: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, xu.panda@zte.com.cn Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 On Wed, Nov 9, 2022 at 2:25 PM wrote: > > 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 = { > -- Applied as 6.2 material, thanks!