Skip to content

Commit

Permalink
stm class: sys-t: Fix the use of time_after()
Browse files Browse the repository at this point in the history
commit 283f87c upstream.

The operands of time_after() are in a wrong order in both instances in
the sys-t driver. Fix that.

Signed-off-by: Alexander Shishkin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Fixes: 39f1023 ("stm class: p_sys-t: Add support for CLOCKSYNC packets")
Fixes: d69d5e8 ("stm class: Add MIPI SyS-T protocol support")
Cc: [email protected] # v4.20+
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
virtuoso authored and gregkh committed Mar 25, 2020
1 parent f7ef7a0 commit 2439259
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/hwtracing/stm/p_sys-t.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static struct configfs_attribute *sys_t_policy_attrs[] = {
static inline bool sys_t_need_ts(struct sys_t_output *op)
{
if (op->node.ts_interval &&
time_after(op->ts_jiffies + op->node.ts_interval, jiffies)) {
time_after(jiffies, op->ts_jiffies + op->node.ts_interval)) {
op->ts_jiffies = jiffies;

return true;
Expand All @@ -250,8 +250,8 @@ static inline bool sys_t_need_ts(struct sys_t_output *op)
static bool sys_t_need_clock_sync(struct sys_t_output *op)
{
if (op->node.clocksync_interval &&
time_after(op->clocksync_jiffies + op->node.clocksync_interval,
jiffies)) {
time_after(jiffies,
op->clocksync_jiffies + op->node.clocksync_interval)) {
op->clocksync_jiffies = jiffies;

return true;
Expand Down

0 comments on commit 2439259

Please sign in to comment.