mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix for macros in fs/partitions/ldm.h
@ 2001-08-04 20:57 Robert Schiele
  0 siblings, 0 replies; only message in thread
From: Robert Schiele @ 2001-08-04 20:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anton Altaparmakov, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]

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/

[-- Attachment #2: Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-04 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-04 20:57 [PATCH] Fix for macros in fs/partitions/ldm.h Robert Schiele

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

all inboxes | Powered by JetHome®