[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181119.150142.777293649598457239.davem@davemloft.net>
Date: Mon, 19 Nov 2018 15:01:42 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: xuechaojing@...wei.com
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
wulike1@...wei.com, chiqijun@...wei.com, fy.wang@...wei.com,
tony.qu@...wei.com, luoshaokai@...wei.com
Subject: Re: [PATCH 1/4] net-next/hinic:replace multiply and division
operators
From: Xue Chaojing <xuechaojing@...wei.com>
Date: Mon, 19 Nov 2018 06:12:31 +0000
> @@ -530,7 +536,9 @@ int hinic_wq_allocate(struct hinic_wqs *wqs, struct hinic_wq *wq,
> return -EINVAL;
> }
>
> - num_wqebbs_per_page = ALIGN(wq_page_size, wqebb_size) / wqebb_size;
> + wqebb_size_shift = ilog2(wqebb_size);
You now have introduced the assumption that these various sizes are a power
of two.
You should check for this, either at compile time or at run time, in
order to avoid surprises and hard to debug issues in the future.
Thank you.
Powered by blists - more mailing lists