public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Valdis.Kletnieks@vt.edu
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.12-rc5-mm1 - missing #define SECTIONS_SHIFT in sparsemem
Date: Tue, 31 May 2005 17:02:37 +0100	[thread overview]
Message-ID: <20050531160237.GA21094@shadowen.org> (raw)
In-Reply-To: <200505282238.j4SMcYdN014990@turing-police.cc.vt.edu>

Could you try this patch out for me.  I've reordered the code
slightly to better match the original intent of the code whilst
avoiding the reference to the undefined value.

Cheers.

-apw

=== 8< ===

valdis.kletnieks@vt.edu reported that with -Wundef triggers warnings
for each use of mm.h, out of the flags fit code for SPARSEMEM.
Change this check so that it uses the actually allocated flags widths
rather than the maxima for each.  This matches the original intent,
adding the nodes field if there is space and avoids the reference
to SECTIONS_SHIFT which was triggering the warning.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>

---
 mm.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/include/linux/mm.h current/include/linux/mm.h
--- reference/include/linux/mm.h
+++ current/include/linux/mm.h
@@ -421,12 +421,6 @@ static inline void put_page(struct page 
  * with space for node: | SECTION | NODE | ZONE | ... | FLAGS |
  *   no space for node: | SECTION |     ZONE    | ... | FLAGS |
  */
-#if SECTIONS_SHIFT+NODES_SHIFT+ZONES_SHIFT <= FLAGS_RESERVED
-#define NODES_WIDTH		NODES_SHIFT
-#else
-#define NODES_WIDTH		0
-#endif
-
 #ifdef CONFIG_SPARSEMEM
 #define SECTIONS_WIDTH		SECTIONS_SHIFT
 #else
@@ -435,6 +429,12 @@ static inline void put_page(struct page 
 
 #define ZONES_WIDTH		ZONES_SHIFT
 
+#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= FLAGS_RESERVED
+#define NODES_WIDTH		NODES_SHIFT
+#else
+#define NODES_WIDTH		0
+#endif
+
 /* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */
 #define SECTIONS_PGOFF		((sizeof(page_flags_t)*8) - SECTIONS_WIDTH)
 #define NODES_PGOFF		(SECTIONS_PGOFF - NODES_WIDTH)

      parent reply	other threads:[~2005-05-31 16:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-28 22:38 2.6.12-rc5-mm1 - missing #define SECTIONS_SHIFT in sparsemem Valdis.Kletnieks
2005-05-29 23:27 ` Andy Whitcroft
2005-05-30 16:31   ` Valdis.Kletnieks
2005-05-31 16:02 ` Andy Whitcroft [this message]

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=20050531160237.GA21094@shadowen.org \
    --to=apw@shadowen.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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