mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch added to -mm tree
@ 2022-03-04  1:55 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-03-04  1:55 UTC (permalink / raw)
  To: mm-commits, sj, xhao, akpm


The patch titled
     Subject: mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release()
has been added to the -mm tree.  Its filename is
     mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Xin Hao <xhao@linux.alibaba.com>
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 <xhao@linux.alibaba.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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 =
_

Patches currently in -mm which might be from xhao@linux.alibaba.com are

mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-04  1:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04  1:55 + mm-damon-sysfs-remove-repeat-container_of-in-damon_sysfs_kdamond_release.patch added to -mm tree Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).