The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Hans Rosenfeld" <hans.rosenfeld@amd.com>
To: "Matt Mackall" <mpm@selenic.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] /proc/pid/pagemap: fix PM_SPECIAL macro
Date: Mon, 11 Feb 2008 17:53:18 +0100	[thread overview]
Message-ID: <20080211165318.GA10660@escobedo.amd.com> (raw)

There seems to be a bug in the PM_SPECIAL macro for /proc/pid/pagemap.
I think masking out those other bits makes more sense then setting all
those mask bits.


Signed-off-by: Hans Rosenfeld <Hans.Rosenfeld@amd.com>

---
 fs/proc/task_mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index ae4d3f2..2e8a6fa 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -531,7 +531,7 @@ struct pagemapread {
 #define PM_RESERVED_BITS    3
 #define PM_RESERVED_OFFSET  (64 - PM_RESERVED_BITS)
 #define PM_RESERVED_MASK    (((1LL<<PM_RESERVED_BITS)-1) << PM_RESERVED_OFFSET)
-#define PM_SPECIAL(nr)      (((nr) << PM_RESERVED_OFFSET) | PM_RESERVED_MASK)
+#define PM_SPECIAL(nr)      (((nr) << PM_RESERVED_OFFSET) & PM_RESERVED_MASK)
 #define PM_NOT_PRESENT      PM_SPECIAL(1LL)
 #define PM_SWAP             PM_SPECIAL(2LL)
 #define PM_END_OF_BUFFER    1
-- 
1.5.3.7



                 reply	other threads:[~2008-02-11 16:56 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=20080211165318.GA10660@escobedo.amd.com \
    --to=hans.rosenfeld@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.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