Skip to content

Commit 1f3a8e4

Browse files
committed
ktime: Get rid of ktime_equal()
No point in going through loops and hoops instead of just comparing the values. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]>
1 parent 8b0e195 commit 1f3a8e4

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

fs/dlm/lock.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,6 @@ static int nodeid_warned(int nodeid, int num_nodes, int *warned)
13951395
void dlm_scan_waiters(struct dlm_ls *ls)
13961396
{
13971397
struct dlm_lkb *lkb;
1398-
ktime_t zero = 0;
13991398
s64 us;
14001399
s64 debug_maxus = 0;
14011400
u32 debug_scanned = 0;
@@ -1409,7 +1408,7 @@ void dlm_scan_waiters(struct dlm_ls *ls)
14091408
mutex_lock(&ls->ls_waiters_mutex);
14101409

14111410
list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) {
1412-
if (ktime_equal(lkb->lkb_wait_time, zero))
1411+
if (!lkb->lkb_wait_time)
14131412
continue;
14141413

14151414
debug_scanned++;
@@ -1419,7 +1418,7 @@ void dlm_scan_waiters(struct dlm_ls *ls)
14191418
if (us < dlm_config.ci_waitwarn_us)
14201419
continue;
14211420

1422-
lkb->lkb_wait_time = zero;
1421+
lkb->lkb_wait_time = 0;
14231422

14241423
debug_expired++;
14251424
if (us > debug_maxus)

fs/nfs/flexfilelayout/flexfilelayout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ nfs4_ff_layoutstat_start_io(struct nfs4_ff_layout_mirror *mirror,
623623
struct nfs4_flexfile_layout *ffl = FF_LAYOUT_FROM_HDR(mirror->layout);
624624

625625
nfs4_ff_start_busy_timer(&layoutstat->busy_timer, now);
626-
if (ktime_equal(mirror->start_time, 0))
626+
if (!mirror->start_time)
627627
mirror->start_time = now;
628628
if (mirror->report_interval != 0)
629629
report_interval = (s64)mirror->report_interval * 1000LL;

include/linux/ktime.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,6 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
9696
/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
9797
#define ktime_to_ns(kt) (kt)
9898

99-
100-
/**
101-
* ktime_equal - Compares two ktime_t variables to see if they are equal
102-
* @cmp1: comparable1
103-
* @cmp2: comparable2
104-
*
105-
* Compare two ktime_t variables.
106-
*
107-
* Return: 1 if equal.
108-
*/
109-
static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
110-
{
111-
return cmp1 == cmp2;
112-
}
113-
11499
/**
115100
* ktime_compare - Compares two ktime_t variables for less, greater or equal
116101
* @cmp1: comparable1

net/ipv6/mip6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static inline int mip6_report_rl_allow(ktime_t stamp,
191191
int allow = 0;
192192

193193
spin_lock_bh(&mip6_report_rl.lock);
194-
if (!ktime_equal(mip6_report_rl.stamp, stamp) ||
194+
if (mip6_report_rl.stamp != stamp ||
195195
mip6_report_rl.iif != iif ||
196196
!ipv6_addr_equal(&mip6_report_rl.src, src) ||
197197
!ipv6_addr_equal(&mip6_report_rl.dst, dst)) {

0 commit comments

Comments
 (0)