From patchwork Thu Mar 3 07:53:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: haoxin X-Patchwork-Id: 12767177 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 B80D6C433EF for ; Thu, 3 Mar 2022 07:53:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4706E8D0002; Thu, 3 Mar 2022 02:53:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F9B28D0001; Thu, 3 Mar 2022 02:53:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C2218D0002; Thu, 3 Mar 2022 02:53:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 1C5E08D0001 for ; Thu, 3 Mar 2022 02:53:26 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D0E34204CD for ; Thu, 3 Mar 2022 07:53:25 +0000 (UTC) X-FDA: 79202309970.03.0E6A2C3 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf26.hostedemail.com (Postfix) with ESMTP id AC7A6140009 for ; Thu, 3 Mar 2022 07:53:24 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V66qkpz_1646293999; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0V66qkpz_1646293999) by smtp.aliyun-inc.com(127.0.0.1); Thu, 03 Mar 2022 15:53:20 +0800 From: Xin Hao To: sj@kernel.org Cc: xhao@linux.alibaba.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() Date: Thu, 3 Mar 2022 15:53:14 +0800 Message-Id: <20220303075314.22502-1-xhao@linux.alibaba.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: AC7A6140009 X-Stat-Signature: hdeir91p7bo5mghpd13bjya964pd4rwh Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf26.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.57 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com X-HE-Tag: 1646294004-71604 X-Bogosity: Ham, tests=bogofilter, spamicity=0.002806, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In damon_sysfs_kdamond_release(), we have use container_of() to get "kdamond" pointer, so there no need to get it once again. Signed-off-by: Xin Hao Reviewed-by: SeongJae Park --- 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 =