Skip to content

Commit

Permalink
clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it
Browse files Browse the repository at this point in the history
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1644890154-64915-3-git-send-email-wangqing@vivo.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Wang Qing authored and Stephen Boyd committed Feb 17, 2022
1 parent e783362 commit b191fe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clk/mvebu/armada-37xx-periph.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/jiffies.h>

#define TBG_SEL 0x0
#define DIV_SEL0 0x4
Expand Down Expand Up @@ -541,7 +542,7 @@ static void clk_pm_cpu_set_rate_wa(struct clk_pm_cpu *pm_cpu,
* We are going to L0 with rate >= 1GHz. Check whether we have been at
* L1 for long enough time. If not, go to L1 for 20ms.
*/
if (pm_cpu->l1_expiration && jiffies >= pm_cpu->l1_expiration)
if (pm_cpu->l1_expiration && time_is_before_eq_jiffies(pm_cpu->l1_expiration))
goto invalidate_l1_exp;

regmap_update_bits(base, ARMADA_37XX_NB_CPU_LOAD,
Expand Down

0 comments on commit b191fe3

Please sign in to comment.