lkml.org 
[lkml]   [2007]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@yahoo.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@yahoo.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@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: 2007-04-29 10:23    [W:0.118 / U:33.904 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site