Skip to content

Commit

Permalink
page-cgroup: trivial cleanup
Browse files Browse the repository at this point in the history
Add forward declarations for struct pglist_data, mem_cgroup.

Remove __init, __meminit from function prototypes and inline functions.

Remove redundant inclusion of bit_spinlock.h.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Vladimir Davydov authored and Linus Torvalds committed Aug 8, 2014
1 parent 747db95 commit 434584f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions include/linux/page_cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ enum {
#ifndef __GENERATING_BOUNDS_H
#include <generated/bounds.h>

struct pglist_data;

#ifdef CONFIG_MEMCG
#include <linux/bit_spinlock.h>
struct mem_cgroup;

/*
* Page Cgroup can be considered as an extended mem_map.
Expand All @@ -27,16 +29,16 @@ struct page_cgroup {
struct mem_cgroup *mem_cgroup;
};

void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat);
extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);

#ifdef CONFIG_SPARSEMEM
static inline void __init page_cgroup_init_flatmem(void)
static inline void page_cgroup_init_flatmem(void)
{
}
extern void __init page_cgroup_init(void);
extern void page_cgroup_init(void);
#else
void __init page_cgroup_init_flatmem(void);
static inline void __init page_cgroup_init(void)
extern void page_cgroup_init_flatmem(void);
static inline void page_cgroup_init(void)
{
}
#endif
Expand All @@ -48,11 +50,10 @@ static inline int PageCgroupUsed(struct page_cgroup *pc)
{
return !!(pc->flags & PCG_USED);
}

#else /* CONFIG_MEMCG */
#else /* !CONFIG_MEMCG */
struct page_cgroup;

static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
{
}

Expand All @@ -65,10 +66,9 @@ static inline void page_cgroup_init(void)
{
}

static inline void __init page_cgroup_init_flatmem(void)
static inline void page_cgroup_init_flatmem(void)
{
}

#endif /* CONFIG_MEMCG */

#include <linux/swap.h>
Expand Down

0 comments on commit 434584f

Please sign in to comment.