drivers/char/misc.c: use bitmap/bitops functions for dynamic minor number allocation
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 15 Dec 2009 02:00:31 +0000 (18:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2009 16:53:27 +0000 (08:53 -0800)
commit1f2f38d89d1eced2079189cd880eeacee378370a
tree143d4219d4249591ef1e74688673f9b78ce06aa7
parent4ae717da8d18839487485f6ae608b8542790fdd3
drivers/char/misc.c: use bitmap/bitops functions for dynamic minor number allocation

Use DECLARE_BITMAP(), find_first_zero_bit(), set_bit() and clear_bit()
instead of rewriting code to do it with the minor number dynamic
allocation bitmap.

We need to invert the bit position to keep the code behaviour of using the
last minor numbers first, since we don't have a find_last_zero_bit.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/misc.c