From: Greg KH <gregkh@linuxfoundation.org>
To: cgel.zte@gmail.com
Cc: arve@android.com, tkjos@android.com, maco@android.com,
joel@joelfernandes.org, christian@brauner.io, hridya@google.com,
surenb@google.com, linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] drivers/android: remove redundant ret variable
Date: Tue, 4 Jan 2022 12:44:53 +0100 [thread overview]
Message-ID: <YdQzNX77nT2OIh7W@kroah.com> (raw)
In-Reply-To: <20220104113500.602158-1-chi.minghao@zte.com.cn>
On Tue, Jan 04, 2022 at 11:35:00AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Return value from list_lru_count() directly instead
> of taking this in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
> ---
> drivers/android/binder_alloc.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> index 340515f54498..4f221d1839f4 100644
> --- a/drivers/android/binder_alloc.c
> +++ b/drivers/android/binder_alloc.c
> @@ -1049,18 +1049,14 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
> static unsigned long
> binder_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
> {
> - unsigned long ret = list_lru_count(&binder_alloc_lru);
> - return ret;
> + return list_lru_count(&binder_alloc_lru);
> }
>
> static unsigned long
> binder_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
> {
> - unsigned long ret;
> -
> - ret = list_lru_walk(&binder_alloc_lru, binder_alloc_free_page,
> + return list_lru_walk(&binder_alloc_lru, binder_alloc_free_page,
> NULL, sc->nr_to_scan);
> - return ret;
Is the compiler output any different?
If not, why make this change?
What did you use to test this change is equivalent?
thanks,
greg k-h
next prev parent reply other threads:[~2022-01-04 11:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 11:35 cgel.zte
2022-01-04 11:44 ` Greg KH [this message]
2022-01-05 9:19 ` 'Re: [PATCH] drivers/android: remove redundant ret variable' cgel.zte
2022-01-05 10:09 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YdQzNX77nT2OIh7W@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arve@android.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=christian@brauner.io \
--cc=hridya@google.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=surenb@google.com \
--cc=tkjos@android.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®