* [PATCH 3/5] Make set_wrprotect() value safe
@ 2005-08-24 18:43 Zachary Amsden
2005-08-24 19:55 ` Chris Wright
0 siblings, 1 reply; 2+ messages in thread
From: Zachary Amsden @ 2005-08-24 18:43 UTC (permalink / raw)
To: Andrew Morton, Linux Kernel Mailing List,
Virtualization Mailing List, H. Peter Anvin, Zwane Mwaikambo,
Chris Wright, Martin Bligh, Pratap Subrahmanyam, Christopher Li,
Zachary Amsden
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 3/5] Make set_wrprotect() value safe
2005-08-24 18:43 [PATCH 3/5] Make set_wrprotect() value safe Zachary Amsden
@ 2005-08-24 19:55 ` Chris Wright
0 siblings, 0 replies; 2+ messages in thread
From: Chris Wright @ 2005-08-24 19:55 UTC (permalink / raw)
To: Zachary Amsden
Cc: Andrew Morton, Linux Kernel Mailing List,
Virtualization Mailing List, H. Peter Anvin, Zwane Mwaikambo,
Chris Wright, Martin Bligh, Pratap Subrahmanyam, Christopher Li
* Zachary Amsden (zach@vmware.com) wrote:
> The macro set_wrprotect() should not be defined to have a value. Make it
> a do {} while(0) instead of ({}).
> Noticed by Chris Wright.
I already fixed that one in the virt-2.6 git tree.
thanks,
-chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-24 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24 18:43 [PATCH 3/5] Make set_wrprotect() value safe Zachary Amsden
2005-08-24 19:55 ` Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox