Re: [patch 2/3] mm: hugetlb -- get rid of redundant if operation

From: Ingo Molnar
Date: Fri Jan 02 2009 - 04:23:21 EST



Andrew Cc:-ed.

patch looks correct to me.

Reviewed-by: Ingo Molnar <mingo@xxxxxxx>

Ingo

* Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:

> At this point we already know that 'addr' is not NULL
> so get rid of redundant 'if'. Probably gcc eliminate it
> by optimization pass.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
> CC: William Irwin <wli@xxxxxxxxxxxxxx>
> ---
> mm/hugetlb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: linux-2.6.git/mm/hugetlb.c
> ===================================================================
> --- linux-2.6.git.orig/mm/hugetlb.c
> +++ linux-2.6.git/mm/hugetlb.c
> @@ -991,8 +991,7 @@ __attribute__((weak)) int alloc_bootmem_
> * puts them into the mem_map).
> */
> m = addr;
> - if (m)
> - goto found;
> + goto found;
> }
> hstate_next_node(h);
> nr_nodes--;
>
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/