Skip to content

Commit b2f5f60

Browse files
John Sperbeckmehmetb0
John Sperbeck
authored andcommitted
mm: memcg: declare do_memsw_account inline
BugLink: https://bugs.launchpad.net/bugs/2096827 commit 89dd878 upstream. In commit 66d60c4 ("mm: memcg: move legacy memcg event code into memcontrol-v1.c"), the static do_memsw_account() function was moved from a .c file to a .h file. Unfortunately, the traditional inline keyword wasn't added. If a file (e.g., a unit test) includes the .h file, but doesn't refer to do_memsw_account(), it will get a warning like: mm/memcontrol-v1.h:41:13: warning: unused function 'do_memsw_account' [-Wunused-function] 41 | static bool do_memsw_account(void) | ^~~~~~~~~~~~~~~~ Link: https://lkml.kernel.org/r/[email protected] Fixes: 66d60c4 ("mm: memcg: move legacy memcg event code into memcontrol-v1.c") Signed-off-by: John Sperbeck <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent a87941d commit b2f5f60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memcontrol-v1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n);
3939
iter = mem_cgroup_iter(NULL, iter, NULL))
4040

4141
/* Whether legacy memory+swap accounting is active */
42-
static bool do_memsw_account(void)
42+
static inline bool do_memsw_account(void)
4343
{
4444
return !cgroup_subsys_on_dfl(memory_cgrp_subsys);
4545
}

0 commit comments

Comments
 (0)