diff options
| author | Marcelo Tosatti <marcelo.tosatti@cyclades.com> | 2004-10-19 18:40:03 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-19 18:40:03 -0700 |
| commit | 6902800445f4bfd224e82c7c3df74e48e925c001 (patch) | |
| tree | 7995103d0f1ad923c1937efee90fa7f948676a14 | |
| parent | 66ee38629134735537adb9c1a2fef83b418656f6 (diff) | |
[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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | include/linux/swapops.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 0cfc704d0565..d4c7db35e708 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -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) { - return (entry.val >> SWP_TYPE_SHIFT(entry)) & - ((1 << MAX_SWAPFILES_SHIFT) - 1); + return (entry.val >> SWP_TYPE_SHIFT(entry)); } /* |
