From: Dan Carpenter <dan.carpenter@oracle.com>
To: Marc Dietrich <marvin24@gmx.de>
Cc: linux-tegra@vger.kernel.org, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Sakshi Bansal <sakshi.april5@gmail.com>
Subject: Re: [PATCH] staging: nvec: fixed few coding style warnings
Date: Thu, 15 Oct 2015 11:48:12 +0300 [thread overview]
Message-ID: <20151015084812.GP7289@mwanda> (raw)
In-Reply-To: <1971511.Ec7FdKlGRN@fb07-iapwap2>
On Thu, Oct 15, 2015 at 10:39:02AM +0200, Marc Dietrich wrote:
> > > - if (unlikely(nvec->rx == NULL)) {
> > > + if (!unlikely(nvec->rx)) {
> >
> > This isn't right. You intented to say:
> >
> > if (unlikely(!nvec->rx)) {
> >
> > But even better to just remove the unlikely entirely.
> >
> > if (!nvec->rx) {
>
> why? the "unlikely" is there to optimize a critical interrupt path.
The rule is that drivers should not use likely/unlikely() unless there
is a difference in benchmark numbers. How critical can it be when it's
always followed by a udelay(100)???
There are more important optimizations needed here.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Marc Dietrich <marvin24@gmx.de>
Cc: gregkh@linuxfoundation.org, linux-tegra@vger.kernel.org,
Sakshi Bansal <sakshi.april5@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: nvec: fixed few coding style warnings
Date: Thu, 15 Oct 2015 11:48:12 +0300 [thread overview]
Message-ID: <20151015084812.GP7289@mwanda> (raw)
In-Reply-To: <1971511.Ec7FdKlGRN@fb07-iapwap2>
On Thu, Oct 15, 2015 at 10:39:02AM +0200, Marc Dietrich wrote:
> > > - if (unlikely(nvec->rx == NULL)) {
> > > + if (!unlikely(nvec->rx)) {
> >
> > This isn't right. You intented to say:
> >
> > if (unlikely(!nvec->rx)) {
> >
> > But even better to just remove the unlikely entirely.
> >
> > if (!nvec->rx) {
>
> why? the "unlikely" is there to optimize a critical interrupt path.
The rule is that drivers should not use likely/unlikely() unless there
is a difference in benchmark numbers. How critical can it be when it's
always followed by a udelay(100)???
There are more important optimizations needed here.
regards,
dan carpenter
next prev parent reply other threads:[~2015-10-15 8:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 14:08 [PATCH] staging: nvec: fixed few coding style warnings Sakshi Bansal
2015-10-14 18:12 ` Dan Carpenter
2015-10-14 18:12 ` Dan Carpenter
2015-10-15 8:39 ` Marc Dietrich
2015-10-15 8:39 ` Marc Dietrich
2015-10-15 8:48 ` Dan Carpenter [this message]
2015-10-15 8:48 ` Dan Carpenter
2015-10-15 9:15 ` Marc Dietrich
2015-10-15 9:15 ` Marc Dietrich
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=20151015084812.GP7289@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=marvin24@gmx.de \
--cc=sakshi.april5@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.