Re: [PATCH] staging: comedi: cb_pcidas64: move loop invariant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 08, 2017 at 12:26:27AM +0300, Dan Carpenter wrote:
> On Wed, Mar 08, 2017 at 08:18:50AM +1100, Tobin C. Harding wrote:
> > On Tue, Mar 07, 2017 at 08:03:16PM +0100, Greg Kroah-Hartman wrote:
> > > On Tue, Mar 07, 2017 at 01:29:35PM +1100, Tobin C. Harding wrote:
> > > > Loop invariant is inside the loop so code checks invariant on each
> > > > iteration of the loop. Invariant can be moved outside of the loop so
> > > > it is only checked once.
> > > > 
> > > > Move loop invariant outside of for loop.
> > > 
> > > But does it really matter?  Does this fix an issue?  Make something
> > > faster in a _measurable_ way?  Did you test this on the hardware?
> > 
> > Good points, patch is untested and does not fix a particular
> > issue. Lesson learned.
> 
> You've learned the wrong lesson.  The right lesson is to sell your patch
> better.  If you had said, "This improves readability and makes things
> more uniform" then it would probably have been accepted.  But you
> sold it as a speed up and it obviously isn't.

Thanks Dan, I appreciate you taking the time to explain.

thanks,
Tobin
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux