[PATCH] Fix for macros in fs/partitions/ldm.h

From: Robert Schiele (rschiele@uni-mannheim.de)
Date: Sat Aug 04 2001 - 15:57:02 EST


Hello,

in fs/partitions/ldm.h from 2.4.8-pre3 there were duplicate
definitions of the macros SYS_IND(p), NR_SECTS(p) and START_SECT(p),
for each a correct (with parantesises aroud the parameter) and an
incorrect (without parantesises aroud the parameter) one.

In 2.4.8-pre4 one duplicate of each macro was deleted, unfortunately
the correct ones. :-(

The parantesises are needed, because in fs/partitions/ldm.c these
macros are called with an arithmetic expression as parameter.

So you might consider applying the following simple patch to replace
the incorrect #defines with the correct ones. --- The only differences
are the parantesises.

Robert

--- linux-2.4.8-pre4/fs/partitions/ldm.h~ Sat Aug 4 16:39:15 2001
+++ linux-2.4.8-pre4/fs/partitions/ldm.h Sat Aug 4 17:08:35 2001
@@ -81,13 +81,13 @@
 #define TOC_BITMAP2 "log" /* bitmaps in the TOCBLOCK. */
 
 /* Borrowed from msdos.c */
-#define SYS_IND(p) (get_unaligned(&p->sys_ind))
-#define NR_SECTS(p) ({ __typeof__(p->nr_sects) __a = \
- get_unaligned(&p->nr_sects); \
+#define SYS_IND(p) (get_unaligned(&(p)->sys_ind))
+#define NR_SECTS(p) ({ __typeof__((p)->nr_sects) __a = \
+ get_unaligned(&(p)->nr_sects); \
                                         le32_to_cpu(__a); \
                                 })
-#define START_SECT(p) ({ __typeof__(p->start_sect) __a = \
- get_unaligned(&p->start_sect); \
+#define START_SECT(p) ({ __typeof__((p)->start_sect) __a = \
+ get_unaligned(&(p)->start_sect);\
                                         le32_to_cpu(__a); \
                                 })
 

-- 
Robert Schiele			mailto:rschiele@uni-mannheim.de
Tel./Fax: +49-621-10059		http://webrum.uni-mannheim.de/math/rschiele/


- 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/



This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:33 EST