mtd/util mkfs.jffs2.c,1.35,1.36

David Woodhouse dwmw2 at infradead.org
Thu Apr 3 06:49:25 EST 2003


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv9906

Modified Files:
	mkfs.jffs2.c 
Log Message:
fix cpu_to_je16() et al w.r.t. args with sideeffects

Index: mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- mkfs.jffs2.c	15 Feb 2003 00:08:10 -0000	1.35
+++ mkfs.jffs2.c	3 Apr 2003 11:49:22 -0000	1.36
@@ -651,8 +651,9 @@
 #undef je16_to_cpu
 #undef je32_to_cpu
 #undef jemode_to_cpu
-#define t16(x) ( (target_endian==__BYTE_ORDER)?x:bswap_16(x) )
-#define t32(x) ( (target_endian==__BYTE_ORDER)?x:bswap_32(x) )
+
+#define t16(x) ({ uint16_t b = x; (target_endian==__BYTE_ORDER)?x:bswap_16(b); })
+#define t32(x) ({ uint32_t b = x; (target_endian==__BYTE_ORDER)?x:bswap_32(b); })
 
 #define cpu_to_je16(x) ((jint16_t){t16(x)})
 #define cpu_to_je32(x) ((jint32_t){t32(x)})




More information about the linux-mtd-cvs mailing list