Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8733684rwb; Thu, 24 Nov 2022 03:40:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RqSHPdcFChSEAIMqyrM7P+7RAVSVV1UB12P1HgvGz4G82+ilIX3qO8YJPisGgEFP180l2 X-Received: by 2002:aa7:d943:0:b0:469:cdb7:7fe4 with SMTP id l3-20020aa7d943000000b00469cdb77fe4mr14342623eds.261.1669290055642; Thu, 24 Nov 2022 03:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669290055; cv=none; d=google.com; s=arc-20160816; b=vFTmC1EpNRnhyEnaJHS6ZBtDodnHzIrXAduvLD9Y+YVCOWElvt9T/2mFlZYcaGK9Lj UNp4zjGW69iwnXwe+MueQMCzOSfpfNEov8cfoAdzuimigys6sWlbVej3D/hizhbKJyoW /NR/+4AA6e7t4WUC3XX7kSbX3pdWkz8NsXURQuITu3bdD3649Cy3RhKAYc4YJlJyp/YM JCI/4dQYOPsI+C4b9/aNpkQC6riaM40/x2rFAvi1/iApV7p+Hwy6vglBCGjlqQbTAO2H kwQggMnZPW6axhZFvzEFTYSio/SUk3QaI7LWretGUtwo6yS7jw79uxE21RBoIfl2JMSl FWwQ== 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=FB2nwHCjneAjspEN1zThNqJlh6QKcbzzVsbZSMyBnUM=; b=IfES4AEfTBURSeqELRn5JRKVcgpMGPRIRD13JDJm9NxXdPRbn9A2UJP/aBhiRB2svx SUiY0TGY2oSEUSR7OgDkSnFsA94cZ/qiwvHk85zxttXX8P2hTI06mkpS7DOqrYnufWjM ux148STA1kWaNbdoaGa3HlT9uS39d/UiUm4z1VB943CvUB2i17Y33yari+l1xPTLAJUo fSaPm6kcYRi84gCaob3OXAcU7rMfxFvK3/O4gMvEdR8PzFowEPC8If6pJ7d+4rXR0peM PwTJzDfA4ouQc8lvaDiamPtd3QOkUw8MyrS1eM7HiXemMQpJrphwQKk2uuMdkaQT1+nK luMQ== 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 y4-20020a056402440400b004674af16d57si890530eda.490.2022.11.24.03.40.30; Thu, 24 Nov 2022 03:40:55 -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 S229863AbiKXL3M (ORCPT + 88 others); Thu, 24 Nov 2022 06:29:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiKXL3K (ORCPT ); Thu, 24 Nov 2022 06:29:10 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E731114C for ; Thu, 24 Nov 2022 03:29:09 -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 mxhk.zte.com.cn (FangMail) with ESMTPS id 4NHwkD3fDHz5BNRf; Thu, 24 Nov 2022 19:29:08 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl1.zte.com.cn with SMTP id 2AOBSw5F026946; Thu, 24 Nov 2022 19:28:58 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Thu, 24 Nov 2022 19:29:01 +0800 (CST) Date: Thu, 24 Nov 2022 19:29:01 +0800 (CST) X-Zmail-TransId: 2b04637f557d190ecad6 X-Mailer: Zmail v1.0 Message-ID: <202211241929015476424@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHQgXSBtbTogdm1zY2FuOiB1c2Ugc3lzZnNfZW1pdCgpIHRvIGluc3RlYWQgb2Ygc2NucHJpbnRmKCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AOBSw5F026946 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 637F5584.000 by FangMail milter! X-FangMail-Envelope: 1669289348/4NHwkD3fDHz5BNRf/637F5584.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637F5584.000/4NHwkD3fDHz5BNRf 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: Xu Panda Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 1147034c86a2..ac494806ee51 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -5404,7 +5404,7 @@ static ssize_t show_enabled(struct kobject *kobj, struct kobj_attribute *attr, c if (IS_ENABLED(CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG) && get_cap(LRU_GEN_NONLEAF_YOUNG)) caps |= BIT(LRU_GEN_NONLEAF_YOUNG); - return snprintf(buf, PAGE_SIZE, "0x%04x\n", caps); + return sysfs_emit(buf, "0x%04x\n", caps); } /* see Documentation/admin-guide/mm/multigen_lru.rst for details */ -- 2.15.2