[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1406091304140.3830@nanos>
Date: Mon, 9 Jun 2014 13:06:48 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Stanislav Fomichev <stfomichev@...dex-team.ru>
cc: viresh.kumar@...aro.org, paul.gortmaker@...driver.com,
peterz@...radead.org, stuart.w.hayes@...il.com,
david.vrabel@...rix.com, linux-kernel@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists