linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use 'do {} while (0)' for empty flush_tlb_fix_spurious_fault() macro
@ 2011-12-18  0:32 Jesper Juhl
  2011-12-18  0:43 ` Michel Lespinasse
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2011-12-18  0:32 UTC (permalink / raw)
  To: x86
  Cc: Eric Dumazet, linux-mm, linux-kernel, Andrew Morton,
	Michel Lespinasse, Hugh Dickins, Andrea Arcangeli,
	KAMEZAWA Hiroyuki, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Rik van Riel, Mel Gorman, Johannes Weiner

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1079 bytes --]

If one builds the kernel with -Wempty-body one gets this warning:

  mm/memory.c:3432:46: warning: suggest braces around empty body in an !ifc statement [-Wempty-body]

due to the fact that 'flush_tlb_fix_spurious_fault' is a macro that
can sometimes be defined to nothing.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 arch/x86/include/asm/pgtable.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 18601c8..ebe7e76 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -703,7 +703,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm,
 	pte_update(mm, addr, ptep);
 }
 
-#define flush_tlb_fix_spurious_fault(vma, address)
+#define flush_tlb_fix_spurious_fault(vma, address) do {} while (0)
 
 #define mk_pmd(page, pgprot)   pfn_pmd(page_to_pfn(page), (pgprot))
 
-- 
1.7.8


-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-18  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-18  0:32 [PATCH] Use 'do {} while (0)' for empty flush_tlb_fix_spurious_fault() macro Jesper Juhl
2011-12-18  0:43 ` Michel Lespinasse
2011-12-18  1:00   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox