From: "David Laight" <redacted>
Date: Tue, 17 Jan 2012 17:22:18 -0000
quoted
quoted
+ /* RSS table size must be an order of 2 */
+ if (rss_rings != (1 << order_base_2(rss_rings)))
+ return -EINVAL;
This is an obscure way to make this kind of test.
The canonical way is:
if (is_power_of_2(rss_rings))
Which is probably (x & {x-1)) == 0
What is your point? is_power_of_2() is the common helper function we
have in the kernel which makes that proper calculation.
And more importantly it has a meaningful name.
You make no contribution to this dicussion by saying how it may or
may not be implemented.
What makes it worse is that you didn't even bother to take the time to
check before making your statement. This wastes everyone's time.