All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: zcache: fix ppc64 and other arches where PAGE_SIZE!=4K
@ 2013-01-23 21:46 ` Dan Magenheimer
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Magenheimer @ 2013-01-23 21:46 UTC (permalink / raw)
  To: devel, linux-kernel, gregkh, linux-mm, ngupta, konrad.wilk,
	sjenning, minchan, dan.magenheimer

Replace raw constant 12 with PAGE_SHIFT to fix non-x86 arches and
provoke build failure if PAGE_SHIFT is too big

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
---
 drivers/staging/zcache/zbud.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c
index a7c4361..6835fab 100644
--- a/drivers/staging/zcache/zbud.c
+++ b/drivers/staging/zcache/zbud.c
@@ -103,8 +103,8 @@ struct zbudpage {
 		struct {
 			unsigned long space_for_flags;
 			struct {
-				unsigned zbud0_size:12;
-				unsigned zbud1_size:12;
+				unsigned zbud0_size: PAGE_SHIFT;
+				unsigned zbud1_size: PAGE_SHIFT;
 				unsigned unevictable:2;
 			};
 			struct list_head budlist;
@@ -112,6 +112,9 @@ struct zbudpage {
 		};
 	};
 };
+#if (PAGE_SHIFT * 2) + 2 > BITS_PER_LONG
+#error "zbud won't work for this arch, PAGE_SIZE is too large"
+#endif
 
 struct zbudref {
 	union {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-25 20:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 21:46 [PATCH 1/2] staging: zcache: fix ppc64 and other arches where PAGE_SIZE!=4K Dan Magenheimer
2013-01-23 21:46 ` Dan Magenheimer
2013-01-23 21:46 ` [PATCH 2/2] staging: zcache: optional support for zsmalloc as alternate allocator Dan Magenheimer
2013-01-23 21:46   ` Dan Magenheimer
2013-01-25 19:26   ` Greg KH
2013-01-25 19:26     ` Greg KH
2013-01-25 20:47     ` Dan Magenheimer
2013-01-25 20:47       ` Dan Magenheimer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.