From a9260cb494530356a494b91caca5e11ed9b25299 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Thu, 6 May 2021 23:09:22 +0000 Subject: [PATCH] ANDROID: kfence: clean up unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 62fa525d1e50 ("BACKPORT: kfence: add test suite") removed memcg sanity checks from original change as part of the backport. However, this left a couple variables unused. This patch removes such variables fixing the following warnings: mm/kfence/kfence_test.c:270:23: warning: unused variable ‘s’ [-Wunused-variable] 270 | struct kmem_cache *s = test_cache ?: kmalloc_caches[kmalloc_type(GFP_KERNEL)][kmalloc_index(size)]; | ^ mm/kfence/kfence_test.c:269:17: warning: unused variable ‘page’ [-Wunused-variable] 269 | struct page *page = virt_to_head_page(alloc); | ^~~~ Bug: 183339614 Fixes: 62fa525d1e50 ("BACKPORT: kfence: add test suite") Reported-by: kernelci.org bot Signed-off-by: Carlos Llamas Change-Id: Ifac52f9021be61840cb43bc8d20c9728f3beb948 --- mm/kfence/kfence_test.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index 9c9d74dc8497..b959548a47ce 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -266,9 +266,6 @@ static void *test_alloc(struct kunit *test, size_t size, gfp_t gfp, enum allocat alloc = kmalloc(size, gfp); if (is_kfence_address(alloc)) { - struct page *page = virt_to_head_page(alloc); - struct kmem_cache *s = test_cache ?: kmalloc_caches[kmalloc_type(GFP_KERNEL)][kmalloc_index(size)]; - if (policy == ALLOCATE_ANY) return alloc; if (policy == ALLOCATE_LEFT && IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))