struct mem_cgroup is declared twice. One has been declared
at forward struct declaration. Remove the duplicate.
Signed-off-by: Wan Jiabing <[email protected]>
---
include/linux/memcontrol.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 0c04d39a7967..f0ae33a0f175 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1068,8 +1068,6 @@ void split_page_memcg(struct page *head, unsigned int nr);
#define MEM_CGROUP_ID_SHIFT 0
#define MEM_CGROUP_ID_MAX 0
-struct mem_cgroup;
-
static inline struct mem_cgroup *page_memcg(struct page *page)
{
return NULL;
--
2.25.1
On Tue, Mar 30, 2021 at 10:03 AM Wan Jiabing <[email protected]> wrote:
>
> struct mem_cgroup is declared twice. One has been declared
> at forward struct declaration. Remove the duplicate.
>
> Signed-off-by: Wan Jiabing <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Thanks.
> ---
> include/linux/memcontrol.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 0c04d39a7967..f0ae33a0f175 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1068,8 +1068,6 @@ void split_page_memcg(struct page *head, unsigned int nr);
> #define MEM_CGROUP_ID_SHIFT 0
> #define MEM_CGROUP_ID_MAX 0
>
> -struct mem_cgroup;
> -
> static inline struct mem_cgroup *page_memcg(struct page *page)
> {
> return NULL;
> --
> 2.25.1
>
On Tue 30-03-21 10:02:36, Wan Jiabing wrote:
> struct mem_cgroup is declared twice. One has been declared
> at forward struct declaration. Remove the duplicate.
Duplicate declaration shouldn't really cause any problems. You are right
that there is one which is independent on CONFIG_MEMCG so the below one
is not needed though. It would be great if the changelog mentioned that
so that.
> Signed-off-by: Wan Jiabing <[email protected]>
Acked-by: Michal Hocko <[email protected]>
> ---
> include/linux/memcontrol.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 0c04d39a7967..f0ae33a0f175 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1068,8 +1068,6 @@ void split_page_memcg(struct page *head, unsigned int nr);
> #define MEM_CGROUP_ID_SHIFT 0
> #define MEM_CGROUP_ID_MAX 0
>
> -struct mem_cgroup;
> -
> static inline struct mem_cgroup *page_memcg(struct page *page)
> {
> return NULL;
> --
> 2.25.1
--
Michal Hocko
SUSE Labs