mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fix for recent swap changes on 64 bit archs
@ 2002-06-03  7:51 Anton Blanchard
  0 siblings, 0 replies; only message in thread
From: Anton Blanchard @ 2002-06-03  7:51 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, torvalds


This fixes two shift warnings on 64 bit archs.

Anton

diff -urN linux-2.5_ppc64/include/linux/swapops.h linux-2.5_work/include/linux/swapops.h
--- linux-2.5_ppc64/include/linux/swapops.h	Mon Jun  3 17:36:21 2002
+++ linux-2.5_work/include/linux/swapops.h	Mon Jun  3 16:50:02 2002
@@ -10,7 +10,7 @@
  * swp_entry_t's are *never* stored anywhere in their arch-dependent format.
  */
 #define SWP_TYPE_SHIFT(e)	(sizeof(e.val) * 8 - MAX_SWAPFILES_SHIFT)
-#define SWP_OFFSET_MASK(e)	((1 << SWP_TYPE_SHIFT(e)) - 1)
+#define SWP_OFFSET_MASK(e)	((1UL << SWP_TYPE_SHIFT(e)) - 1)
 
 /*
  * Store a type+offset into a swp_entry_t in an arch-independent format
@@ -19,7 +19,7 @@
 {
 	swp_entry_t ret;
 
-	ret.val = (type << SWP_TYPE_SHIFT(ret)) |
+	ret.val = ((unsigned long)type << SWP_TYPE_SHIFT(ret)) |
 			(offset & SWP_OFFSET_MASK(ret));
 	return ret;
 }

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

only message in thread, other threads:[~2002-06-03  7:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-03  7:51 Fix for recent swap changes on 64 bit archs Anton Blanchard

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

all inboxes | Powered by JetHome®