Thread (1 message) 1 message, 1 author, 2016-07-27

Re: [PATCH v2 05/15] IB/pvrdma: Add UAR support

From: Adit Ranadive <hidden>
Date: 2016-07-27 17:58:38


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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help