linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, andi@firstfloor.org
Subject: [Patch] mempolicy: remove redundant code
Date: Fri, 12 Mar 2010 05:24:06 -0500	[thread overview]
Message-ID: <cf18f8341003120224k243ff3fdq6d4a7acfe15dccc8@mail.gmail.com> (raw)

1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
the following loop, needn't init to policy_zone anymore.

2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
to MPOL_MODE_FLAGS in mempolicy.h.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
 ---
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index bda230e..66d71f4 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -128,9 +128,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 {
        int nd, k;

-       /* Check that there is something useful in this mask */
-       k = policy_zone;
-
        for_each_node_mask(nd, *nodemask) {
                struct zone *z;

@@ -146,7 +143,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)

 static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
 {
-       return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES);
+    return pol->flags & MPOL_MODE_FLAGS;
 }

 static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
--
1.6.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2010-03-12 10:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 10:24 Bob Liu [this message]
2010-03-12 20:37 ` [Patch] mempolicy: remove redundant code David Rientjes
2010-03-13  5:03   ` Bob Liu
  -- strict thread matches above, loose matches on Subject: below --
2010-03-13  5:01 [PATCH] " Bob Liu
2010-03-13  9:52 ` David Rientjes
2010-03-13 12:33   ` Bob Liu
2010-03-14 11:50 Bob Liu
2010-03-14 23:18 ` David Rientjes
2010-03-15  1:11   ` Bob Liu

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=cf18f8341003120224k243ff3fdq6d4a7acfe15dccc8@mail.gmail.com \
    --to=lliubbo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).