lkml.org 
[lkml]   [2002]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectFix for recent swap changes on 64 bit archs

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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.036 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site