linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup/cgroup.c: replace 'of->kn->priv' with of_cft()
@ 2020-11-06 14:47 Hui Su
  2020-11-25 13:00 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Hui Su @ 2020-11-06 14:47 UTC (permalink / raw)
  To: tj, lizefan, hannes, cgroups, linux-kernel; +Cc: sh_def

we have supplied the inline function: of_cft() in cgroup.h.

So replace the direct use 'of->kn->priv' with inline func
of_cft(), which is more readable.

Signed-off-by: Hui Su <sh_def@163.com>
---
 kernel/cgroup/cgroup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e41c21819ba0..078d7f167890 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3657,7 +3657,7 @@ static ssize_t cgroup_freeze_write(struct kernfs_open_file *of,
 
 static int cgroup_file_open(struct kernfs_open_file *of)
 {
-	struct cftype *cft = of->kn->priv;
+	struct cftype *cft = of_cft(of);
 
 	if (cft->open)
 		return cft->open(of);
@@ -3666,7 +3666,7 @@ static int cgroup_file_open(struct kernfs_open_file *of)
 
 static void cgroup_file_release(struct kernfs_open_file *of)
 {
-	struct cftype *cft = of->kn->priv;
+	struct cftype *cft = of_cft(of);
 
 	if (cft->release)
 		cft->release(of);
@@ -3677,7 +3677,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
 {
 	struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
 	struct cgroup *cgrp = of->kn->parent->priv;
-	struct cftype *cft = of->kn->priv;
+	struct cftype *cft = of_cft(of);
 	struct cgroup_subsys_state *css;
 	int ret;
 
@@ -3727,7 +3727,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
 
 static __poll_t cgroup_file_poll(struct kernfs_open_file *of, poll_table *pt)
 {
-	struct cftype *cft = of->kn->priv;
+	struct cftype *cft = of_cft(of);
 
 	if (cft->poll)
 		return cft->poll(of, pt);
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cgroup/cgroup.c: replace 'of->kn->priv' with of_cft()
  2020-11-06 14:47 [PATCH] cgroup/cgroup.c: replace 'of->kn->priv' with of_cft() Hui Su
@ 2020-11-25 13:00 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2020-11-25 13:00 UTC (permalink / raw)
  To: Hui Su; +Cc: lizefan, hannes, cgroups, linux-kernel

On Fri, Nov 06, 2020 at 10:47:40PM +0800, Hui Su wrote:
> we have supplied the inline function: of_cft() in cgroup.h.
> 
> So replace the direct use 'of->kn->priv' with inline func
> of_cft(), which is more readable.
> 
> Signed-off-by: Hui Su <sh_def@163.com>

Applied to cgroup/for-5.10-fixes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 14:47 [PATCH] cgroup/cgroup.c: replace 'of->kn->priv' with of_cft() Hui Su
2020-11-25 13:00 ` Tejun Heo

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).