ANDROID: kfence: clean up unused variables

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 <bot@kernelci.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Ifac52f9021be61840cb43bc8d20c9728f3beb948
This commit is contained in:
Carlos Llamas 2021-05-06 23:09:22 +00:00 • committed by Michael Bestas
commit a9260cb494
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -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))