Skip to content

Commit 105ae04

Browse files
tobluxakpm00
authored andcommitted
ocfs2: use max() to improve ocfs2_dlm_seq_show()
Use the max() macro to simplify the ocfs2_dlm_seq_show() function and improve its readability. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7f86b29 commit 105ae04

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/ocfs2/dlmglue.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,11 +3151,8 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v)
31513151
#ifdef CONFIG_OCFS2_FS_STATS
31523152
if (!lockres->l_lock_wait && dlm_debug->d_filter_secs) {
31533153
now = ktime_to_us(ktime_get_real());
3154-
if (lockres->l_lock_prmode.ls_last >
3155-
lockres->l_lock_exmode.ls_last)
3156-
last = lockres->l_lock_prmode.ls_last;
3157-
else
3158-
last = lockres->l_lock_exmode.ls_last;
3154+
last = max(lockres->l_lock_prmode.ls_last,
3155+
lockres->l_lock_exmode.ls_last);
31593156
/*
31603157
* Use d_filter_secs field to filter lock resources dump,
31613158
* the default d_filter_secs(0) value filters nothing,

0 commit comments

Comments
 (0)