Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp619347pxm; Thu, 3 Mar 2022 00:49:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWiXz7M2vTy122K0phL7YVFofPPxZ2ugPgilgDQ1liPwElJ86wytN9DcsYAapXl1Y11TlC X-Received: by 2002:a17:902:e804:b0:151:50e6:d444 with SMTP id u4-20020a170902e80400b0015150e6d444mr24524723plg.141.1646297385519; Thu, 03 Mar 2022 00:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646297385; cv=none; d=google.com; s=arc-20160816; b=C/RmNlQ94B6bO5VLkswLjGrnukRgUXcTYsELn3w2aRMp9xbeP8fqIvKQSUQ9F9UCNB 76sGZ1xQuQ4qZSAAT5wpfxduGTn2Djxu3DF6x6fHy0apTJoin6saSxbqN18+l3AQ4Bhk tMo21ZDNYsAjzlWSsm+eS0CHl7PQrxxfp+yU5DGdn23/A2GF6w6TM2008iIJw0lYyvP4 kVNbscKwvRAX5UOrrui3WdiJdNe2daNGc7w22oT6nO/1tY5riRhQaMYFKLIfz/nlGs50 0zURKKc7BH16Mc7HIh7XMLbhmSYrSOcadyNr1DF0HhF4AfJpsnFN/OXzW/nG0J0UUSV/ nPbg== 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=3AdcxRfspnKrvP+sQfMl4A86WWS77DtZ6PrHrU0wRFg=; b=VhS/05/SN8dclqRcujgxOU4AEl9p44JlyZM1YLVYkGoNzQq1z/j6M8cKgcplV2LGG1 MIKU4dqZPb/XszJtyNVRx84huyPNrLVGUurCp96NxlENh9hno+1/A0W5fNNXWth3WHRq 66ln0SfB26hTx5PfWBEJHSxJkOwLKoyl8YVMXta1baF2uFsmnMmaJ5aABdoJX5qYHLYv 9KUxMG5Er7WP09MCjrDH8vrGz/1FG2AZSS6DiUbLmOQ8YC8e1IEG3exSecvBO+KXH49E lMHRLtZH6B2jZVUlPMN5a+K7w1k8+0txapabPgZ147fnxptqbScILB6baZha/PG4Uo2I JJHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ffszb4I6; 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 g18-20020a63fa52000000b003755cc87e8dsi1482542pgk.500.2022.03.03.00.49.30; Thu, 03 Mar 2022 00:49:45 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ffszb4I6; 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 S230199AbiCCIn1 (ORCPT + 99 others); Thu, 3 Mar 2022 03:43:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbiCCIn0 (ORCPT ); Thu, 3 Mar 2022 03:43:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA5321E17 for ; Thu, 3 Mar 2022 00:42:40 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 26177B82423 for ; Thu, 3 Mar 2022 08:42:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7237BC004E1; Thu, 3 Mar 2022 08:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646296957; bh=wxx3qu0sZ0wQv3hV3t/+/URflGLqV8/abpb8AHjS6C0=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=ffszb4I60l5M5WMVrHLPIVQQ2S1VhGgAcyC4rX5vqFN+04Frzv1IHDLCuqPu81n0L WDsu8UNbVQJNZDiaXpkAsdujuKhx6Ju9iIlV5PWMnfxDK1CUEyBbfMdRtSnjfqrWyS afyvS2wVV42YoL/87PfsJb4Me6pjRiTK89fmodWi6iu8SYkzUsm7p0nT4ZgxrcfXBl AeZ8q2NyPwxwzvs/49E+0/LXm3dplkhTn7giMvVGzYuQoKHVKrwijfz0gLS/4mn/3Z 7jp41i6tzs3SMSymTS9qlxXUYHQH3wW/qLuFplILfq5CyGD5HRFEiu8IlAKHNgNaAW dOBUatl8q/ukw== From: SeongJae Park To: Xin Hao Cc: sj@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() Date: Thu, 3 Mar 2022 08:42:35 +0000 Message-Id: <20220303084235.356-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220303075314.22502-1-xhao@linux.alibaba.com> X-Spam-Status: No, score=-7.5 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 Xin, On Thu, 3 Mar 2022 15:53:14 +0800 Xin Hao wrote: > In damon_sysfs_kdamond_release(), we have use container_of() to get > "kdamond" pointer, so there no need to get it once again. Good catch! Thank you always :) > > Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Thanks, SJ > --- > mm/damon/sysfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c > index a4ad6b473b0a..687e7c7e8dea 100644 > --- a/mm/damon/sysfs.c > +++ b/mm/damon/sysfs.c > @@ -2432,7 +2432,7 @@ static void damon_sysfs_kdamond_release(struct kobject *kobj) > > if (kdamond->damon_ctx) > damon_destroy_ctx(kdamond->damon_ctx); > - kfree(container_of(kobj, struct damon_sysfs_kdamond, kobj)); > + kfree(kdamond); > } > > static struct kobj_attribute damon_sysfs_kdamond_state_attr = > -- > 2.27.0