Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp143686pxp; Wed, 16 Mar 2022 02:27:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWDcliF09p75kiiHCI63UXOTVRp0tGTMBX/rF9UieXgi17WkyDDPfd3q0x+tRcXkhslBX0 X-Received: by 2002:a17:90b:3a8a:b0:1c6:47fe:c9b0 with SMTP id om10-20020a17090b3a8a00b001c647fec9b0mr6487380pjb.151.1647422860558; Wed, 16 Mar 2022 02:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647422860; cv=none; d=google.com; s=arc-20160816; b=xOk7lUeizfQTOKZxhILrCh4BfTjrQvtcWcg+NSGyj6rRlvVzNvDWql8mGOjDMZf+Jy hidEPR1W+O7kXCfcvWVORoW/zwclOBXGAmxRbu7qNFeu51J7APQrK9Jbm3d/cn2oQ5eX +w8TvkKNo3vt8Cd2yrJQcPrGqqmsu4XkZUXLCQNq6SNO2sRhu331BddVjS4bb8Lnno9o TN9gbeT5pjOlJ06E7Iz0Q2016PoAkE7tD58yJouMqgnSs+PwyOKwOt4JD4m6sjR0esJt iUXTwVJvjgEuTNR4nw1s5bh1xcDdZI7R8AlguAEl5BHMCn8ZglwXIJVCIzt6eh7ApbLr rLfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oVhyymeNibiUzk2U0yPHBvjl0FuPdn842GXHRZ8cs8I=; b=Do3YxmmWldEUOBuFPrAYVopXGaYjDOS9efUOBUHA57gLdo2nvrJAyPRcSYvGRvo5Dx ZGN06ry5NtWkxB/zwVn35IZss2aqMAyQpAeJ9VDvzXUhphgvbkoj4tD6wQBfzlJ/qZox DO9WAML6dxg78VQObNQPpVIvE6FblgCV9kXfqhH4OJwPOUtDf9+QwYcV9oY/BVqKVuN8 PATbY4tFxP8YNwKu9sAlSvIbNsOaondCs1IK2yxzH+qdIlMECFV/H/vz34+mz/wsx4rr vA5RFBdHu49a4any2BJpYpMkC9GPorUSvSiutLqeXod8sqmN6FYg0PZRcZ5YqRmvm5P6 lE5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WKqSf2pU; 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 z10-20020aa7888a000000b004f70a91cacbsi1615408pfe.9.2022.03.16.02.27.14; Wed, 16 Mar 2022 02:27:40 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WKqSf2pU; 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 S1354668AbiCPIyn (ORCPT + 99 others); Wed, 16 Mar 2022 04:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346087AbiCPIyj (ORCPT ); Wed, 16 Mar 2022 04:54:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D3C27FE9 for ; Wed, 16 Mar 2022 01:53:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 51F5461560 for ; Wed, 16 Mar 2022 08:53:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 394A4C340E9; Wed, 16 Mar 2022 08:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647420804; bh=ekLZb1lbsVmd4fFmXwiqzIWmyw2ad5ve/nwLpaF/zPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=WKqSf2pUUMqXLJTkULj7fj1QQVTwBXv7eUcNotlQpZexaIEytHZ0X+SSewVT+razl UKeiir/DNztl1Kh7SK+llTzjK7sW5TK64rjqjU8kYhsNqJqdg7Qx3J7yNHs/Jrs7r/ dPUZspJqIUdow6AZX6DIEHvcw47rW+x4KrO02Ca6na6EVTVQevcMRctfrEVg/kc7sf 3+cnisHSa4xsVu3Z65QNMWotf4nQZsh24Z9J+JnNPRJ1k0wrxWYpgAWN1Qioxh977f XQiXdbx2UDHkbQMo53Id24mTIbfiUfr1c8YFr22/ng1JZsH3zN9pmy2jN9tt9OzFZr 6qMGHeGWw3UOQ== From: sj@kernel.org To: Miaohe Lin Cc: akpm@linux-foundation.org, sj@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon: minor cleanup for damon_pa_young Date: Wed, 16 Mar 2022 08:53:15 +0000 Message-Id: <20220316085315.21054-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220316081528.6034-1-linmiaohe@huawei.com> X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Miaohe, Thank you for this patch! On Wed, 16 Mar 2022 16:15:28 +0800 Miaohe Lin wrote: > if need_lock is true but folio_trylock fails, we should return false > instead of NULL to match the return value type exactly. No functional > change intended. > > Signed-off-by: Miaohe Lin Reviewed-by: SeongJae Park Thanks, SJ > --- > mm/damon/paddr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c > index a01495cebdad..21474ae63bc7 100644 > --- a/mm/damon/paddr.c > +++ b/mm/damon/paddr.c > @@ -152,7 +152,7 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz) > need_lock = !folio_test_anon(folio) || folio_test_ksm(folio); > if (need_lock && !folio_trylock(folio)) { > folio_put(folio); > - return NULL; > + return false; > } > > rmap_walk(folio, &rwc); > > -- > 2.23.0 > > >