All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux/memcontrol.h: Remove duplicate struct declaration
@ 2021-03-30  2:02 Wan Jiabing
  2021-03-30  2:13 ` [External] " Muchun Song
  2021-03-30  8:32 ` Michal Hocko
  0 siblings, 2 replies; 3+ messages in thread
From: Wan Jiabing @ 2021-03-30  2:02 UTC (permalink / raw)
  To: Andrew Morton, Shakeel Butt, Johannes Weiner, Roman Gushchin,
	Michal Hocko, Muchun Song, Alex Shi, Alexander Duyck, Chris Down,
	Yafang Shao, Wei Yang, linux-kernel
  Cc: kael_w, Wan Jiabing

struct mem_cgroup is declared twice. One has been declared
at forward struct declaration. Remove the duplicate.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [External] [PATCH] linux/memcontrol.h: Remove duplicate struct declaration
  2021-03-30  2:02 [PATCH] linux/memcontrol.h: Remove duplicate struct declaration Wan Jiabing
@ 2021-03-30  2:13 ` Muchun Song
  2021-03-30  8:32 ` Michal Hocko
  1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2021-03-30  2:13 UTC (permalink / raw)
  To: Wan Jiabing
  Cc: Andrew Morton, Shakeel Butt, Johannes Weiner, Roman Gushchin,
	Michal Hocko, Alex Shi, Alexander Duyck, Chris Down, Yafang Shao,
	Wei Yang, LKML, kael_w

On Tue, Mar 30, 2021 at 10:03 AM Wan Jiabing <wanjiabing@vivo.com> wrote:
>
> struct mem_cgroup is declared twice. One has been declared
> at forward struct declaration. Remove the duplicate.
>
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/memcontrol.h: Remove duplicate struct declaration
  2021-03-30  2:02 [PATCH] linux/memcontrol.h: Remove duplicate struct declaration Wan Jiabing
  2021-03-30  2:13 ` [External] " Muchun Song
@ 2021-03-30  8:32 ` Michal Hocko
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2021-03-30  8:32 UTC (permalink / raw)
  To: Wan Jiabing
  Cc: Andrew Morton, Shakeel Butt, Johannes Weiner, Roman Gushchin,
	Muchun Song, Alex Shi, Alexander Duyck, Chris Down, Yafang Shao,
	Wei Yang, linux-kernel, kael_w

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 <wanjiabing@vivo.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-30  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  2:02 [PATCH] linux/memcontrol.h: Remove duplicate struct declaration Wan Jiabing
2021-03-30  2:13 ` [External] " Muchun Song
2021-03-30  8:32 ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.