Skip to contentSkip to conversation

binder: remove redundant variable page_addr

PATCH Superseded Carlos Llamas 2 participants 3 messages Jan 16, 2024 – Mar 7, 2024 1 message not in the archive Android drivers

lore
Share & tools
lore

Carlos Llamas

author maintainer
#1 lore raw

PATCH v2 1/1 binder: remove redundant variable page_addr

In reply to a message not in the archive

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]

---

Notes:
v2: added tags, used char-misc-next as base

 drivers/android/binder_alloc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/android/binder_alloc.c +0 -2
index a4a4dc87ba53..34d7a1494bc7 100644
@@ -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(&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,

base-commit: 5850edccec30325707f953bc088497b3b9041231

Signature · 1 line
2.43.0.275.g3460e3d667-goog
#2 lore raw
Quoted 42 lines · Carlos Llamas

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]

---

Notes:
v2: added tags, used char-misc-next as base

 drivers/android/binder_alloc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/android/binder_alloc.c +0 -2
index a4a4dc87ba53..34d7a1494bc7 100644
@@ -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(&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,
Quoted 4 lines

base-commit: 5850edccec30325707f953bc088497b3b9041231

Signature · 1 line
2.43.0.275.g3460e3d667-goog

This doesn't apply to my tree anymore, can you rebase?

thanks,

greg k-h

author maintainer
#3 lore raw

PATCH v3 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]

---

Notes:
v2: added tags, used char-misc-next as base
v3: rebased, fixed conflicts with 0a97c01cd20b

 drivers/android/binder_alloc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/android/binder_alloc.c +0 -2
index e0e4dc38b692..2e1f261ec5c8 100644
@@ -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.44.0.278.ge034bb2e1d-goog