Commit 69028004 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Linus Torvalds

[PATCH] Remove redundant AND from swp_type()

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").
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 66ee3862
...@@ -30,8 +30,7 @@ static inline swp_entry_t swp_entry(unsigned long type, pgoff_t offset) ...@@ -30,8 +30,7 @@ static inline swp_entry_t swp_entry(unsigned long type, pgoff_t offset)
*/ */
static inline unsigned swp_type(swp_entry_t entry) static inline unsigned swp_type(swp_entry_t entry)
{ {
return (entry.val >> SWP_TYPE_SHIFT(entry)) & return (entry.val >> SWP_TYPE_SHIFT(entry));
((1 << MAX_SWAPFILES_SHIFT) - 1);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment