[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070429011909.032a125d.akpm@linux-foundation.org>
Date: Sun, 29 Apr 2007 01:19:09 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: bbpetkov@...oo.de
Cc: Andy Whitcroft <apw@...dowen.org>, linux-kernel@...r.kernel.org,
Jeremy Fitzhardinge <jeremy@...source.com>
Subject: Re: [PATCH] mm/memory.c: remove warning from an uninitialized
spinlock. was: Re: 2.6.21-rc7-mm2
On Sun, 29 Apr 2007 08:50:49 +0200 Borislav Petkov <bbpetkov@...oo.de> wrote:
>
> Introduce a macro for suppressing gcc from generating a warning about a probable
> unitialized state of a variable.
>
> Signed-off-by: Borislav Petkov <bbpetkov@...oo.de>
>
> ---
>
> Index: linux-mm/include/linux/compiler.h
> ===================================================================
> --- linux-mm.orig/include/linux/compiler.h
> +++ linux-mm/include/linux/compiler.h
> @@ -109,6 +109,10 @@ extern int do_check_likely(struct likeli
> (typeof(ptr)) (__ptr + (off)); })
> #endif
>
> +#ifndef unitialized_var
> +# define unitialized_var(x) x = x
> +#endif
> +
> #endif /* __KERNEL__ */
>
> #endif /* __ASSEMBLY__ */
> Index: linux-mm/mm/memory.c
> ===================================================================
> --- linux-mm.orig/mm/memory.c
> +++ linux-mm/mm/memory.c
> @@ -1488,7 +1488,7 @@ static int apply_to_pte_range(struct mm_
> pte_t *pte;
> int err;
> struct page *pmd_page;
> - spinlock_t *ptl;
> + spinlock_t *unitialized_var(ptl);
>
> pte = (mm == &init_mm) ?
> pte_alloc_kernel(pmd, addr) :
Ho hum. I guess I'll slide this over to Linus if there's not too much
howling, and unless someone can come up with anything better.
I will, however, fix the spelling to "uninitialized" ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists