]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release()
authorXin Hao <xhao@linux.alibaba.com>
Tue, 22 Mar 2022 21:50:00 +0000 (14:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:13 +0000 (15:57 -0700)
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/damon/sysfs.c

index 58bcd2f5b02aea06e161e2ab0905f30f299728b6..48e434cd43d8e87e50672248f8a0e5a3d00c1f0d 100644 (file)
@@ -2345,7 +2345,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 =