On 7/18/16 6:25 AM, Leon Romanovsky wrote:
quoted
+int pvrdma_uar_table_init(struct pvrdma_dev *dev)
+{
+ u32 num = dev->dsr->caps.max_uar;
+ u32 mask = num - 1;
+ struct pvrdma_id_table *tbl = &dev->uar_table.tbl;
+
+ /* Power of 2 */
+ if (num != 1 << (ffs(num) - 1))
+ return -EINVAL;
Can functions/macros defined in include/linux/log2.h replace the code
above?
I guess I can replace the ffs stuff with is_power_of_2 from log2.h.
Thanks,
Adit
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html