Skip to content

Commit 0ef017d

Browse files
yhuang-inteltorvalds
authored andcommitted
mm, swap: improve readability via make spin_lock/unlock balanced
This is just a cleanup patch, no functionality change. In cluster_list_add_tail(), spin_lock_nested() is used to lock the cluster, while unlock_cluster() is used to unlock the cluster. To improve the code readability, use spin_unlock() directly to unlock the cluster. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: "Huang, Ying" <[email protected]> Acked-by: Tim Chen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9c1cc2e commit 0ef017d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/swapfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void cluster_list_add_tail(struct swap_cluster_list *list,
335335
ci_tail = ci + tail;
336336
spin_lock_nested(&ci_tail->lock, SINGLE_DEPTH_NESTING);
337337
cluster_set_next(ci_tail, idx);
338-
unlock_cluster(ci_tail);
338+
spin_unlock(&ci_tail->lock);
339339
cluster_set_next_flag(&list->tail, idx, 0);
340340
}
341341
}

0 commit comments

Comments
 (0)