From: Akinobu Mita Date: Tue, 12 Nov 2013 23:07:01 +0000 (-0800) Subject: ocfs2: use find_last_bit() X-Git-Tag: v4.14-rc1~8611^2~254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=518df6bdf38559247ee90b9e59a40fae779d57d0;p=platform%2Fkernel%2Flinux-rpi.git ocfs2: use find_last_bit() We already have find_last_bit(). So just use it as described in the comment. Signed-off-by: Akinobu Mita Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 292a13b..73920ff 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -946,23 +946,9 @@ out: return changed; } -/* This could be faster if we just implmented a find_last_bit, but I - * don't think the circumstances warrant it. */ -static int o2hb_highest_node(unsigned long *nodes, - int numbits) +static int o2hb_highest_node(unsigned long *nodes, int numbits) { - int highest, node; - - highest = numbits; - node = -1; - while ((node = find_next_bit(nodes, numbits, node + 1)) != -1) { - if (node >= numbits) - break; - - highest = node; - } - - return highest; + return find_last_bit(nodes, numbits); } static int o2hb_do_disk_heartbeat(struct o2hb_region *reg)