]> git.karo-electronics.de Git - karo-tx-linux.git/commit
power-supply: Mark 'if' blocks in power_supply_changed_work() with 'likely'
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Sep 2014 12:01:32 +0000 (17:31 +0530)
committerSebastian Reichel <sre@kernel.org>
Tue, 16 Sep 2014 09:01:35 +0000 (11:01 +0200)
commit061f3806bbe4d8e86dddf101f75f49c38d3f1669
treebb37d1a97976d37a4297ca8b1dbeb1ff099435ed
parent1c42a389eaa0fddca6e6d9625e65ff62c9b90e80
power-supply: Mark 'if' blocks in power_supply_changed_work() with 'likely'

The 'if' statements in power_supply_changed_work() are mostly there for taking
care of races and normally they will always evaluate to true. Optimize them for
fast execution with 'likely' statements.

Also there is need to have better comments in code to mention about the races
clearly. Get them in place.

Cc: Zoran Markovic <zrn.markovic@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/power_supply_core.c