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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <bbpetkov@...>
Cc: <linux-kernel@...>, Jeremy Fitzhardinge <jeremy@...>
Date: Friday, April 27, 2007 - 8:22 pm

On Thu, 26 Apr 2007 20:25:19 +0200
Borislav Petkov <bbpetkov@yahoo.de> wrote:


yes, I've been staring unhappily at this for some time.

Your change adds seven bytes of text to this function for no runtime
benefit, just to fix a build-time warning.  It's a general problem.


Often we just leave the warning in place and curse gcc each time it flies
past.  Sometimes the code can be restructured in a sensible fashion to
avoid the warning; often it cannot.

But I don't think I want to put up with a warning coming out of core MM all
the time so let's go with the following silliness which adds no additional
runtime cost.

--- a/mm/memory.c~add-apply_to_page_range-which-applies-a-function-to-a-pte-range-fix
+++ 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) :
_

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.21-rc7-mm2, Andrew Morton, (Thu Apr 26, 1:57 am)
Re: 2.6.21-rc7-mm2 hangs in boot, Randy Dunlap, (Mon Apr 30, 1:01 am)
Re: 2.6.21-rc7-mm2 hangs in boot, Andrew Morton, (Mon Apr 30, 1:23 am)
Re: 2.6.21-rc7-mm2 hangs in boot, Randy Dunlap, (Mon Apr 30, 11:16 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Mon Apr 30, 7:51 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andrew Morton, (Mon Apr 30, 8:12 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Mon Apr 30, 8:45 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andrew Morton, (Mon Apr 30, 9:08 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andi Kleen, (Mon Apr 30, 11:43 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Tue May 1, 1:16 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andi Kleen, (Tue May 1, 2:22 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Tue May 1, 12:22 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Tue May 1, 1:26 pm)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andrew Morton, (Tue May 1, 1:23 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andi Kleen, (Tue May 1, 2:24 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Andrew Morton, (Tue May 1, 1:38 am)
Re: 2.6.21-rc7-mm2 hangs in boot (netconsole), Randy Dunlap, (Tue May 1, 12:15 pm)
Re: 2.6.21-rc7-mm2, Dan Kruchinin, (Sun Apr 29, 3:19 pm)
Re: 2.6.21-rc7-mm2, Andrew Morton, (Sun Apr 29, 3:48 pm)
[-mm patch] MMC: make tifm_sd_set_dma_data() static, Adrian Bunk, (Sat Apr 28, 3:19 pm)
Re: [-mm patch] MMC: make tifm_sd_set_dma_data() static, Pierre Ossman, (Tue May 1, 10:14 am)
Re: [-mm patch] make drivers/misc/thinkpad_acpi:fan_mutex st..., Henrique de Moraes Holschuh..., (Sat Apr 28, 3:58 pm)
Re: [-mm patch] make drivers/misc/thinkpad_acpi:fan_mutex st..., Henrique de Moraes Holschuh..., (Sun Apr 29, 12:09 am)
2.6.21-rc7-mm2 breaks 'lvm vgscan'., , (Thu Apr 26, 10:31 pm)
Re: 2.6.21-rc7-mm2 breaks 'lvm vgscan'., Andrew Morton, (Thu Apr 26, 10:55 pm)
[-mm patch] unexport highlevel_host_reset, Adrian Bunk, (Thu Apr 26, 7:47 pm)
Re: [-mm patch] unexport highlevel_host_reset, Stefan Richter, (Thu Apr 26, 8:16 pm)
Re: [PATCH] mm/memory.c: remove warning from an uninitialize..., Andrew Morton, (Fri Apr 27, 8:22 pm)
Re: [PATCH] mm/memory.c: remove warning from an uninitialize..., Jeremy Fitzhardinge, (Sat Apr 28, 3:03 am)
Re: [PATCH] mm/memory.c: remove warning from an uninitialize..., Jeremy Fitzhardinge, (Fri Apr 27, 8:27 pm)
Re: 2.6.21-rc7-mm2, Andy Whitcroft, (Thu Apr 26, 9:17 am)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Andy Whitcroft, (Thu Apr 26, 9:41 am)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Andy Whitcroft, (Thu Apr 26, 2:14 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Christoph Lameter, (Thu Apr 26, 2:27 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Andy Whitcroft, (Thu Apr 26, 2:40 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Christoph Lameter, (Thu Apr 26, 3:12 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Andy Whitcroft, (Thu Apr 26, 3:48 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Christoph Lameter, (Thu Apr 26, 4:23 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Andy Whitcroft, (Fri Apr 27, 12:55 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Christoph Lameter, (Fri Apr 27, 12:58 pm)
Re: 2.6.21-rc7-mm2 -- PPC link failure, Christoph Lameter, (Thu Apr 26, 2:49 pm)
Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs, Andy Whitcroft, (Thu Apr 26, 8:30 am)
Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs, Andi Kleen, (Thu Apr 26, 9:51 am)
Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs, Mel Gorman, (Thu Apr 26, 9:33 am)
Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs, Mel Gorman, (Thu Apr 26, 10:46 am)
Re: 2.6.21-rc7-mm2 -- x86_64 blade hard hangs, Mel Gorman, (Thu Apr 26, 1:40 pm)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error, Andy Whitcroft, (Thu Apr 26, 8:16 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error, Mel Gorman, (Thu Apr 26, 9:27 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Andi Kleen, (Thu Apr 26, 10:13 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Mel Gorman, (Thu Apr 26, 10:39 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Mel Gorman, (Thu Apr 26, 11:20 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Andi Kleen, (Thu Apr 26, 11:24 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Mel Gorman, (Thu Apr 26, 11:45 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Andi Kleen, (Thu Apr 26, 8:39 pm)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error II, Mel Gorman, (Fri Apr 27, 4:59 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error, Andi Kleen, (Thu Apr 26, 10:11 am)
Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error, Mel Gorman, (Thu Apr 26, 10:31 am)
Re: 2.6.21-rc7-mm2, Gabriel C, (Thu Apr 26, 7:47 am)
Re: 2.6.21-rc7-mm2, Andrew Morton, (Thu Apr 26, 4:37 pm)
Re: 2.6.21-rc7-mm2, Timur Tabi, (Thu Apr 26, 4:57 pm)
Re: 2.6.21-rc7-mm2, Andrew Morton, (Thu Apr 26, 5:33 pm)
Re: 2.6.21-rc7-mm2, Gabriel C, (Thu Apr 26, 5:13 pm)
Re: 2.6.21-rc7-mm2, Randy Dunlap, (Thu Apr 26, 4:46 pm)
Re: 2.6.21-rc7-mm2, Geert Uytterhoeven, (Sun Apr 29, 4:05 am)