* [PATCH][next] binder: remove redundant variable page_addr
@ 2024-01-06 15:04 Colin Ian King
2024-01-06 16:29 ` Carlos Llamas
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-01-06 15:04 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.i.king@intel.com>
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]
Signed-off-by: Colin Ian King <colin.i.king@intel.com>
---
drivers/android/binder_alloc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index ea5e1ba2d0d7..ed4ca6689c75 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] binder: remove redundant variable page_addr
2024-01-06 15:04 [PATCH][next] binder: remove redundant variable page_addr Colin Ian King
@ 2024-01-06 16:29 ` Carlos Llamas
0 siblings, 0 replies; 2+ messages in thread
From: Carlos Llamas @ 2024-01-06 16:29 UTC (permalink / raw)
To: Colin Ian King
Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner,
Suren Baghdasaryan, kernel-janitors, linux-kernel
On Sat, Jan 06, 2024 at 03:04:57PM +0000, Colin Ian King wrote:
> From: Colin Ian King <colin.i.king@intel.com>
>
> 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]
>
> Signed-off-by: Colin Ian King <colin.i.king@intel.com>
> ---
> drivers/android/binder_alloc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> index ea5e1ba2d0d7..ed4ca6689c75 100644
> --- a/drivers/android/binder_alloc.c
> +++ b/drivers/android/binder_alloc.c
> @@ -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,
> --
> 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:
Fixes: 162c79731448 ("binder: avoid user addresses in debug logs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312060851.cudv98wG-lkp@intel.com/
Feel free to take them for a v2 if you'd like. Either way,
Acked-by: Carlos Llamas <cmllamas@google.com>
--
Carlos Llamas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-06 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-06 15:04 [PATCH][next] binder: remove redundant variable page_addr Colin Ian King
2024-01-06 16:29 ` Carlos Llamas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox