lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input:evdev - Fix to avoid the execution of same instruction in every iteration of for loop.
Hi Shailendra,

On Thu, May 21, 2015 at 12:35:46AM +0530, Shailendra Verma wrote:
> Here in for loop the instruction "len / sizeof(compat_long_t)" is used
> as a terminating condition which is executing (being computed) in every
> iteration of for loop. Below is the armv7-a architecture assembly code with
> similar for loop having the same instruction in condition.Note that the
> instruction "lsr r3, r3, #2" i.e Logical Shift Right on behalf of
> "len / sizeof(compat_long_t)" is getting executed every time the loop
> iterates.

No, it is not. We compile kernel with -O2 and compiler is smart enough
to optimize such constructs.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2015-05-20 21:41    [W:0.067 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site