kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] binder: remove redundant assignment to pointer n
@ 2020-09-10 15:12 Colin King
  2020-09-10 21:35 ` Todd Kjos
  2020-09-11 10:55 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-09-10 15:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Hridya Valsaraju, Suren Baghdasaryan, devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer n is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/android/binder_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 910c53ba2c91..2f846b7ae8b8 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -347,7 +347,7 @@ static void debug_low_async_space_locked(struct binder_alloc *alloc, int pid)
 	 * and at some point we'll catch them in the act. This is more efficient
 	 * than keeping a map per pid.
 	 */
-	struct rb_node *n = alloc->free_buffers.rb_node;
+	struct rb_node *n;
 	struct binder_buffer *buffer;
 	size_t total_alloc_size = 0;
 	size_t num_buffers = 0;
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] binder: remove redundant assignment to pointer n
  2020-09-10 15:12 [PATCH][next] binder: remove redundant assignment to pointer n Colin King
@ 2020-09-10 21:35 ` Todd Kjos
  2020-09-11 10:55 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Todd Kjos @ 2020-09-10 21:35 UTC (permalink / raw)
  To: Colin King
  Cc: open list:ANDROID DRIVERS, Todd Kjos, Greg Kroah-Hartman,
	kernel-janitors, LKML, Suren Baghdasaryan, Hridya Valsaraju,
	Arve Hjønnevåg, Joel Fernandes, Martijn Coenen,
	Christian Brauner

On Thu, Sep 10, 2020 at 8:12 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer n is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Todd Kjos <tkjos@google.com>

> ---
>  drivers/android/binder_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> index 910c53ba2c91..2f846b7ae8b8 100644
> --- a/drivers/android/binder_alloc.c
> +++ b/drivers/android/binder_alloc.c
> @@ -347,7 +347,7 @@ static void debug_low_async_space_locked(struct binder_alloc *alloc, int pid)
>          * and at some point we'll catch them in the act. This is more efficient
>          * than keeping a map per pid.
>          */
> -       struct rb_node *n = alloc->free_buffers.rb_node;
> +       struct rb_node *n;
>         struct binder_buffer *buffer;
>         size_t total_alloc_size = 0;
>         size_t num_buffers = 0;
> --
> 2.27.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] binder: remove redundant assignment to pointer n
  2020-09-10 15:12 [PATCH][next] binder: remove redundant assignment to pointer n Colin King
  2020-09-10 21:35 ` Todd Kjos
@ 2020-09-11 10:55 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2020-09-11 10:55 UTC (permalink / raw)
  To: Colin King
  Cc: devel, Todd Kjos, Greg Kroah-Hartman, kernel-janitors,
	linux-kernel, Suren Baghdasaryan, Hridya Valsaraju,
	Arve Hjønnevåg, Joel Fernandes, Martijn Coenen,
	Christian Brauner

On Thu, Sep 10, 2020 at 04:12:21PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer n is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-11 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 15:12 [PATCH][next] binder: remove redundant assignment to pointer n Colin King
2020-09-10 21:35 ` Todd Kjos
2020-09-11 10:55 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).