]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cgroup: Drop sock_cgroup_classid() dummy implementation
authorMichal Koutný <mkoutny@suse.com>
Tue, 3 Jun 2025 15:45:27 +0000 (17:45 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 3 Jun 2025 18:26:36 +0000 (08:26 -1000)
The semantic of returning 0 is unclear when !CONFIG_CGROUP_NET_CLASSID.
Since there are no callers of sock_cgroup_classid() with that config
anymore we can undefine the helper at all and enforce all (future)
callers to handle cases when !CONFIG_CGROUP_NET_CLASSID.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup-defs.h

index e61687d5e496de26b8092b2346bbc0a862e4dc40..cd7f093e34cd7808a11de86d069a754fcd7f5d11 100644 (file)
@@ -898,14 +898,12 @@ static inline u16 sock_cgroup_prioidx(const struct sock_cgroup_data *skcd)
 #endif
 }
 
+#ifdef CONFIG_CGROUP_NET_CLASSID
 static inline u32 sock_cgroup_classid(const struct sock_cgroup_data *skcd)
 {
-#ifdef CONFIG_CGROUP_NET_CLASSID
        return READ_ONCE(skcd->classid);
-#else
-       return 0;
-#endif
 }
+#endif
 
 static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
                                           u16 prioidx)
@@ -915,13 +913,13 @@ static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
 #endif
 }
 
+#ifdef CONFIG_CGROUP_NET_CLASSID
 static inline void sock_cgroup_set_classid(struct sock_cgroup_data *skcd,
                                           u32 classid)
 {
-#ifdef CONFIG_CGROUP_NET_CLASSID
        WRITE_ONCE(skcd->classid, classid);
-#endif
 }
+#endif
 
 #else  /* CONFIG_SOCK_CGROUP_DATA */