Commit b33112d1cc25e658c334125d127a6ae15d5a0ad6

Authored by Robert P. J. Day
Committed by Linus Torvalds
1 parent 417dcdf99e

kernel/kfifo.c: replace conditional test with is_power_of_2()

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -72,9 +72,9 @@
72 72  
73 73 /*
74 74 * round up to the next power of 2, since our 'let the indices
75   - * wrap' tachnique works only in this case.
  75 + * wrap' technique works only in this case.
76 76 */
77   - if (size & (size - 1)) {
  77 + if (!is_power_of_2(size)) {
78 78 BUG_ON(size > 0x80000000);
79 79 size = roundup_pow_of_two(size);
80 80 }