lkml.org 
[lkml]   [2014]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hrtimers: conditionally lock/unlock spinlock in hrtimer_get_next_event
On Mon, 9 Jun 2014, Stanislav Fomichev wrote:

> In hrtimer_get_next_event we unconditionally lock/unlock spinlock, even if it's
> not required (hrtimer_hres_active() != 0). This patch moves
> locking/unlocking and mindelta range check inside the if clause,
> so we don't execute unnecessary operations.

What's wrong with simply doing:

if (!hrtimer_hres_active())
return mindelta;

That saves and indentation level and makes the code more
readable. Also the lockless check wants a comment why it is correct.

Thanks,

tglx


\
 
 \ /
  Last update: 2014-06-09 14:01    [W:0.059 / U:1.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site