lkml.org 
[lkml]   [2005]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 3/5] Make set_wrprotect() value safe
From
The macro set_wrprotect() should not be defined to have a value.  Make it
a do {} while(0) instead of ({}).
Noticed by Chris Wright.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Patch-subject: Make set_wrprotect() value safe
Index: linux-2.6.13/include/asm-generic/pgtable.h
===================================================================
--- linux-2.6.13.orig/include/asm-generic/pgtable.h 2005-08-15 13:54:42.000000000 -0700
+++ linux-2.6.13/include/asm-generic/pgtable.h 2005-08-22 14:21:05.000000000 -0700
@@ -314,11 +314,11 @@ do { \

#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
#define ptep_set_wrprotect(__mm, __address, __ptep) \
-({ \
+do { \
pte_t __old_pte = *(__ptep); \
set_pte_at((__mm), (__address), (__ptep), \
pte_wrprotect(__old_pte)); \
-})
+} while (0)
#endif

#ifndef __HAVE_ARCH_PTE_SAME
-
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: 2005-08-24 20:47    [W:0.038 / U:21.932 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site