lkml.org 
[lkml]   [2007]   [Apr]   [28]   [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 00:48:37 +0100 Andy Whitcroft <apw@shadowen.org> 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 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 05:29    [W:0.159 / U:0.972 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site