linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove redundant AND from swp_type
@ 2004-10-08 16:53 Marcelo Tosatti
  0 siblings, 0 replies; only message in thread
From: Marcelo Tosatti @ 2004-10-08 16:53 UTC (permalink / raw)
  To: akpm, linux-mm; +Cc: hugh

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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-08 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-08 16:53 [PATCH] remove redundant AND from swp_type Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox