From 3236da62fa5a284825815ed461011b50c7d7432b Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 8 Mar 2024 15:47:25 -0500 Subject: [PATCH] mempool: Remove unused defines Signed-off-by: Mathieu Desnoyers Change-Id: I35f3ce87da25c47097bb76ab9c3aeadee46f5e32 --- src/rseq-mempool.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/rseq-mempool.c b/src/rseq-mempool.c index 5602907..674fa1e 100644 --- a/src/rseq-mempool.c +++ b/src/rseq-mempool.c @@ -34,22 +34,7 @@ * memory allocator provides CPU-Local Storage. */ -/* - * Use high bits of per-CPU addresses to index the pool. - * This leaves the low bits of available to the application for pointer - * tagging (based on next power of 2 alignment of the allocations). - */ -#if RSEQ_BITS_PER_LONG == 64 -# define POOL_INDEX_BITS 16 -#else -# define POOL_INDEX_BITS 8 -#endif -#define MAX_NR_POOLS (1UL << POOL_INDEX_BITS) -#define POOL_INDEX_SHIFT (RSEQ_BITS_PER_LONG - POOL_INDEX_BITS) -#define MAX_POOL_LEN (1UL << POOL_INDEX_SHIFT) -#define MAX_POOL_LEN_MASK (MAX_POOL_LEN - 1) - -#define POOL_SET_NR_ENTRIES POOL_INDEX_SHIFT +#define POOL_SET_NR_ENTRIES RSEQ_BITS_PER_LONG /* * Smallest allocation should hold enough space for a free list pointer. @@ -537,7 +522,6 @@ struct rseq_percpu_pool *rseq_percpu_pool_create(const char *pool_name, percpu_stride = RSEQ_PERCPU_STRIDE; /* Use default */ if (max_nr_cpus < 0 || item_len > percpu_stride || - percpu_stride > (UINTPTR_MAX >> POOL_INDEX_BITS) || percpu_stride < (size_t) rseq_get_page_len() || !is_pow2(percpu_stride)) { errno = EINVAL; -- 2.34.1