From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: akpm@osdl.org, linux-mm@kvack.org
Cc: hugh@veritas.com
Subject: [PATCH] remove redundant AND from swp_type
Date: Fri, 8 Oct 2004 13:53:27 -0300 [thread overview]
Message-ID: <20041008165327.GK16028@logos.cnet> (raw)
Hi,
There is a useless AND in swp_type() function.
We just shifted right SWP_TYPE_SHIFT() bits the value from the swp_entry_t,
and then we AND it with "(1 << 5) - 1" (which is a mask corresponding to the
number of bits used by "type").
Remove it since its redundant.
This is probably some leftover from old code.
--- linux-2.6.9-rc1-mm5.orig/include/linux/swapops.h 2004-09-13 17:34:33.000000000 -0300
+++ linux-2.6.9-rc1-mm5/include/linux/swapops.h 2004-10-08 15:53:39.248697816 -0300
@@ -30,8 +30,7 @@
*/
static inline unsigned swp_type(swp_entry_t entry)
{
- return (entry.val >> SWP_TYPE_SHIFT(entry)) &
- ((1 << MAX_SWAPFILES_SHIFT) - 1);
+ return (entry.val >> SWP_TYPE_SHIFT(entry));
}
/*
--
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:"aart@kvack.org"> aart@kvack.org </a>
reply other threads:[~2004-10-08 16:53 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=20041008165327.GK16028@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--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