Re: [PATCH] mm/memory.c: remove warning from an uninitialized spinlock. was: Re: 2.6.21-rc7-mm2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 29 Apr 2007 00:48:37 +0100 Andy Whitcroft <[email protected]> wrote:

> > +++ a/mm/memory.c
> > @@ -1455,7 +1455,7 @@ static int apply_to_pte_range(struct mm_
> >  	pte_t *pte;
> >  	int err;
> >  	struct page *pmd_page;
> > -	spinlock_t *ptl;
> > +	spinlock_t *ptl = ptl;		/* Suppress gcc warning */
> >  
> >  	pte = (mm == &init_mm) ?
> >  		pte_alloc_kernel(pmd, addr) :
> > _
> > 
> 
> Perhaps we should have some kind definition helper.
> 
> #define suppress_unused(x) x = x
> 
> 	spinlock_t *suppress_unused(ptl);
> 
> Perhaps?

I think so.  It makes it clear what's happening and it allows us to change
the implementation later on if the present trick stops working in later
gcc.  It also allows people to suppress the suppression (some have
expressed concern that it can hide real bugs).

But I lost (or didn't pursue) the bunfight^Wdiscussion last time this came
around.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux