Re: [PATCH for-next 07/13] RDMA/hns: Use macro instead of magic number

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

 



On Wed, Jul 25, 2018 at 03:29:35PM +0800, Lijun Ou wrote:
> This patch mainly uses CMD_CSQ_DESC_NUM instead of magic number
> in order to readability
> 
> Signed-off-by: Lijun Ou <oulijun@xxxxxxxxxx>
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++--
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 3 +++
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index cb677f0..54d8c80 100644
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -701,8 +701,8 @@ static int hns_roce_v2_cmq_init(struct hns_roce_dev *hr_dev)
>  	int ret;
>  
>  	/* Setup the queue entries for command queue */
> -	priv->cmq.csq.desc_num = 1024;
> -	priv->cmq.crq.desc_num = 1024;
> +	priv->cmq.csq.desc_num = CMD_CSQ_DESC_NUM;
> +	priv->cmq.crq.desc_num = CMD_CRQ_DESC_NUM;
>  
>  	/* Setup the lock for command queue */
>  	spin_lock_init(&priv->cmq.csq.lock);
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
> index 3e568b6..76fef4e 100644
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
> @@ -112,6 +112,9 @@
>  	(step_idx == 1 && hop_num == 1) || \
>  	(step_idx == 2 && hop_num == 2))
>  
> +#define CMD_CSQ_DESC_NUM (1024)
> +#define CMD_CRQ_DESC_NUM (1024)

The () is unneeded, prefer not to see it

Jason
--
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