From: Akinobu Mita Date: Wed, 4 Apr 2012 00:08:12 +0000 (+1000) Subject: ocfs2: use find_last_bit() X-Git-Tag: next-20120404~1^2~67 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3999372613472259a09ef70d9d5e323182a5f025;p=karo-tx-linux.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: Andrew Morton --- diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index a4e855e3690e..cf4c766381f9 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -956,23 +956,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)