lkml.org 
[lkml]   [2009]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Fix build warning and avoid checking for mem != null twice
From
On Tue, May 26, 2009 at 4:14 PM, Nikanth Karthikesan <knikanth@suse.de> wrote:
> Fix build warning, "mem_cgroup_is_obsolete defined but not used" when
> CONFIG_DEBUG_VM is not set. Also avoid checking for !mem twice.
>
> Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

I also sent a patch to fix this but yours is much nicer.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

>
> ---
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 01c2d8f..420fc61 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
>        return mem;
>  }
>
> -static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
> -{
> -       if (!mem)
> -               return true;
> -       return css_is_removed(&mem->css);
> -}
> -
> -
>  /*
>  * Call callback function against all cgroup under hierarchy tree.
>  */
> @@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
>        if (unlikely(!mem))
>                return 0;
>
> -       VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
> +       VM_BUG_ON(!mem || css_is_removed(&mem->css));
>
>        while (1) {
>                int ret;
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-05-26 15:23    [W:0.042 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site