Skip to content

Commit edfc4c8

Browse files
Werkovhtejun
authored andcommitted
cgroup: Drop sock_cgroup_classid() dummy implementation
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ý <[email protected]> Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/ Acked-by: Tejun Heo <[email protected]> Reviewed-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 2043ae9 commit edfc4c8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/linux/cgroup-defs.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -898,14 +898,12 @@ static inline u16 sock_cgroup_prioidx(const struct sock_cgroup_data *skcd)
898898
#endif
899899
}
900900

901+
#ifdef CONFIG_CGROUP_NET_CLASSID
901902
static inline u32 sock_cgroup_classid(const struct sock_cgroup_data *skcd)
902903
{
903-
#ifdef CONFIG_CGROUP_NET_CLASSID
904904
return READ_ONCE(skcd->classid);
905-
#else
906-
return 0;
907-
#endif
908905
}
906+
#endif
909907

910908
static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
911909
u16 prioidx)
@@ -915,13 +913,13 @@ static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
915913
#endif
916914
}
917915

916+
#ifdef CONFIG_CGROUP_NET_CLASSID
918917
static inline void sock_cgroup_set_classid(struct sock_cgroup_data *skcd,
919918
u32 classid)
920919
{
921-
#ifdef CONFIG_CGROUP_NET_CLASSID
922920
WRITE_ONCE(skcd->classid, classid);
923-
#endif
924921
}
922+
#endif
925923

926924
#else /* CONFIG_SOCK_CGROUP_DATA */
927925

0 commit comments

Comments
 (0)