]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9e5ca9372d3076020f9011324131224731473547
tree143d4219d4249591ef1e74688673f9b78ce06aa7
parenta1698c975829022a8ebde516eca785b336cdcb20
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