[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070428202527.d52470aa.akpm@linux-foundation.org>
Date: Sat, 28 Apr 2007 20:25:27 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Andy Whitcroft <apw@...dowen.org>
Cc: bbpetkov@...oo.de, 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 00:48:37 +0100 Andy Whitcroft <apw@...dowen.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@...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