binder: remove redundant variable page_addr
Subsystems (2)
PATCH 1/1 binder: remove redundant variable page_addr
From: Colin Ian King <[email protected]>
Variable page_addr is being assigned a value that is never read. The variable is redundant and can be removed.
Cleans up clang scan build warning:
warning: Value stored to 'page_addr' is never read [deadcode.DeadStores]
--- drivers/android/binder_alloc.c | 2 -- 1 file changed, 2 deletions(-)
drivers/android/binder_alloc.c +0 -2
@@ -925,7 +925,6 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)int i;for (i =0 ; i < alloc->buffer_size /PAGE_SIZE ; i++) { -unsigned long page_addr;bool on_lru;if (!alloc->pages[i].page_ptr)
@@ -933,7 +932,6 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc) on_lru =list_lru_del_obj (&binder_freelist, &alloc->pages[i].lru); - page_addr = alloc->buffer + i *PAGE_SIZE ; binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC, "%s: %d: page %d %s\n", __func__, alloc->pid, i,
Signature · 1 line
2.43.0
Quoted 36 lines · Colin Ian King
From: Colin Ian King <[email protected]>
Variable
page_addris being assigned a value that is never read. The variable is redundant and can be removed.Cleans up clang scan build warning:
warning: Value stored to 'page_addr' is never read [deadcode.DeadStores]Signed-off-by Colin Ian King <[email protected]>--- drivers/android/binder_alloc.c | 2 -- 1 file changed, 2 deletions(-)drivers/android/binder_alloc.c +0
-2@@ -925,7 +925,6 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)int i;for (i =0 ; i < alloc->buffer_size /PAGE_SIZE ; i++) { -unsigned long page_addr;bool on_lru;if (!alloc->pages[i].page_ptr)@@ -933,7 +932,6 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc) on_lru =list_lru_del_obj (&binder_freelist, &alloc->pages[i].lru); - page_addr = alloc->buffer + i *PAGE_SIZE ; binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC, "%s: %d: page %d %s\n", __func__, alloc->pid, i,Signature · 1 line
2.43.0
Thanks Colin. I was waiting for this warning to hit mainline so that I could add the following tags to the fix:
Feel free to take them for a v2 if you'd like. Either way,
--
Carlos Llamas