From dc676e8a47273be2385e7c59030ab077300c0659 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Mon, 5 Mar 2012 11:33:23 -0600 Subject: [PATCH] --- yaml --- r: 289191 b: refs/heads/master c: b9ed4f6c9a5ed2358293a92d8b3b268f28b6f2b8 h: refs/heads/master i: 289189: 43e3d9e3a54aa87af94a03d3c5228f718baaba51 289187: 36a33814c8833e6d850626c50f94fe3f9d4d0168 289183: fa494ac8989dfcab474a08ec7f82de4982240483 v: v3 --- [refs] | 2 +- trunk/drivers/staging/zsmalloc/zsmalloc_int.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 00a92bab48f9..e1af936b6575 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6e00ec00b1a76a199b8c0acae401757b795daf57 +refs/heads/master: b9ed4f6c9a5ed2358293a92d8b3b268f28b6f2b8 diff --git a/trunk/drivers/staging/zsmalloc/zsmalloc_int.h b/trunk/drivers/staging/zsmalloc/zsmalloc_int.h index ffb272f89343..92eefc663afc 100644 --- a/trunk/drivers/staging/zsmalloc/zsmalloc_int.h +++ b/trunk/drivers/staging/zsmalloc/zsmalloc_int.h @@ -58,8 +58,10 @@ #define OBJ_INDEX_BITS (BITS_PER_LONG - _PFN_BITS) #define OBJ_INDEX_MASK ((_AC(1, UL) << OBJ_INDEX_BITS) - 1) +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) /* ZS_MIN_ALLOC_SIZE must be multiple of ZS_ALIGN */ -#define ZS_MIN_ALLOC_SIZE 32 +#define ZS_MIN_ALLOC_SIZE \ + MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS)) #define ZS_MAX_ALLOC_SIZE PAGE_SIZE /*