lockdep: Demagic the return value of BFS
authorBoqun Feng <boqun.feng@gmail.com>
Fri, 7 Aug 2020 07:42:22 +0000 (15:42 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 26 Aug 2020 10:42:03 +0000 (12:42 +0200)
commitb11be024de164213f6338973d76ab9ab139120cd
tree99a37e09244b3000272385ded528d38d0814e775
parent224ec489d3cdb0af6794e257eeee39d98dc9c5b2
lockdep: Demagic the return value of BFS

__bfs() could return four magic numbers:

1: search succeeds, but none match.
0: search succeeds, find one match.
-1: search fails because of the cq is full.
-2: search fails because a invalid node is found.

This patch cleans things up by using a enum type for the return value
of __bfs() and its friends, this improves the code readability of the
code, and further, could help if we want to extend the BFS.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200807074238.1632519-4-boqun.feng@gmail.com
kernel/locking/lockdep.c