From patchwork Tue Mar 22 21:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22649C433EF for ; Tue, 22 Mar 2022 21:50:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A15C16B0269; Tue, 22 Mar 2022 17:50:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A0166B026A; Tue, 22 Mar 2022 17:50:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 817256B026B; Tue, 22 Mar 2022 17:50:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 6A3AB6B0269 for ; Tue, 22 Mar 2022 17:50:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 296A18249980 for ; Tue, 22 Mar 2022 21:50:03 +0000 (UTC) X-FDA: 79273365486.26.C2FA857 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id BA0F912001A for ; Tue, 22 Mar 2022 21:50:02 +0000 (UTC) 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 2E8296149C; Tue, 22 Mar 2022 21:50:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 817B4C340EE; Tue, 22 Mar 2022 21:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985801; bh=mFHlkOPpf1q4Sl8uzN0iF58khGGdZSfydcW9vvO2qTM=; h=Date:To:From:In-Reply-To:Subject:From; b=t+NOshuP+FYdWBEymMllldithW5NymHxe8NTuoyrHRr5Ls2HCqsmFotQdwuLlE1Px rzfePvWfkwcpL34gvbcoyO3eRVvcYTSZREefVaBdpfg/RVr05KneMefDmvL2/cBO4a 99MsL8vyX4bGj/cizu6Dc6ZmQPwEmeQA4g2B0M7Q= Date: Tue, 22 Mar 2022 14:50:00 -0700 To: sj@kernel.org,xhao@linux.alibaba.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 227/227] mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() Message-Id: <20220322215001.817B4C340EE@smtp.kernel.org> X-Stat-Signature: qmizrjctfpqn7gmn3mrzu8piwbrbwhma X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BA0F912001A Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=t+NOshuP; dmarc=none; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1647985802-191176 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Xin Hao Subject: mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() In damon_sysfs_kdamond_release(), we have use container_of() to get "kdamond" pointer, so there no need to get it once again. Link: https://lkml.kernel.org/r/20220303075314.22502-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton --- mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/damon/sysfs.c~mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release +++ a/mm/damon/sysfs.c @@ -2345,7 +2345,7 @@ static void damon_sysfs_kdamond_release( 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 =