linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Eric Engestrom <eric.engestrom@imgtec.com>,
	He Kuang <hekuang@huawei.com>, Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH] perf thread: cleanup with list_first_entry_or_null()
Date: Sat, 5 Nov 2016 22:03:30 -0600	[thread overview]
Message-ID: <20161106040330.GA12125@kernel.org> (raw)
In-Reply-To: <CAK7LNATFxF4=nWzO69aNqUkRdeGAyom0Q6k0S+OeKFA2v+fkew@mail.gmail.com>

Em Sun, Nov 06, 2016 at 12:00:22PM +0900, Masahiro Yamada escreveu:
> Hi maintainers,
> 
> Does this patch look good?

>From a quick look it seems ok, I'll try and process it when back home.

- Arnaldo
 
> 2016-09-13 3:29 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> > The combo of list_empty() check and return list_first_entry()
> > can be replaced with list_first_entry_or_null().
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  tools/perf/util/thread.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
> > index 8b10a55..ea951df 100644
> > --- a/tools/perf/util/thread.c
> > +++ b/tools/perf/util/thread.c
> > @@ -107,10 +107,7 @@ void thread__put(struct thread *thread)
> >
> >  struct comm *thread__comm(const struct thread *thread)
> >  {
> > -       if (list_empty(&thread->comm_list))
> > -               return NULL;
> > -
> > -       return list_first_entry(&thread->comm_list, struct comm, list);
> > +       return list_first_entry_or_null(&thread->comm_list, struct comm, list);
> >  }
> >
> >  struct comm *thread__exec_comm(const struct thread *thread)
> > --
> > 1.9.1
> >
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

      reply	other threads:[~2016-11-06  4:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 18:29 [PATCH] perf thread: cleanup with list_first_entry_or_null() Masahiro Yamada
2016-11-06  3:00 ` Masahiro Yamada
2016-11-06  4:03   ` Arnaldo Carvalho de Melo [this message]

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=20161106040330.GA12125@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eric.engestrom@imgtec.com \
    --cc=hekuang@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yamada.masahiro@socionext.com \
    /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;
as well as URLs for NNTP newsgroup(s).