mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Schiele <rschiele@uni-mannheim.de>
To: linux-kernel@vger.kernel.org
Cc: Anton Altaparmakov <antona@users.sourceforge.net>,
	Linus Torvalds <torvalds@transmeta.com>
Subject: [PATCH] Fix for macros in fs/partitions/ldm.h
Date: Sat, 4 Aug 2001 22:57:02 +0200	[thread overview]
Message-ID: <20010804225702.B23455@schiele.swm.uni-mannheim.de> (raw)

[-- 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 --]

                 reply	other threads:[~2001-08-04 20:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010804225702.B23455@schiele.swm.uni-mannheim.de \
    --to=rschiele@uni-mannheim.de \
    --cc=antona@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®