Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1247579

Re: [PATCH] staging: nvec: fixed few coding style warnings

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: nvec: fixed few coding style warnings
Date 2015-10-15 10:50 +0200
Message-ID <qjMoy-1d8-23@gated-at.bofh.it> (permalink)
References <qjuUG-KS-29@gated-at.bofh.it> <qjyOD-6ut-17@gated-at.bofh.it> <qjMox-1d8-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: nvec: fixed few coding style warnings Sakshi Bansal <sakshi.april5@gmail.com> - 2015-10-14 16:10 +0200
  Re: [PATCH] staging: nvec: fixed few coding style warnings Dan Carpenter <dan.carpenter@oracle.com> - 2015-10-14 20:20 +0200
    Re: [PATCH] staging: nvec: fixed few coding style warnings Marc Dietrich <marvin24@gmx.de> - 2015-10-15 10:50 +0200
      Re: [PATCH] staging: nvec: fixed few coding style warnings Dan Carpenter <dan.carpenter@oracle.com> - 2015-10-15 10:50 +0200
        Re: [PATCH] staging: nvec: fixed few coding style warnings Marc Dietrich <marvin24@gmx.de> - 2015-10-15 11:20 +0200

csiph-web