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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 7/18/16 6:25 AM, Leon Romanovsky wrote:
>> +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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux