net: hns3: code optimization for hclge_rx_buffer_calc
authorYunsheng Lin <linyunsheng@huawei.com>
Sat, 2 Feb 2019 14:39:29 +0000 (22:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Feb 2019 16:24:08 +0000 (08:24 -0800)
commit8ca754b13f3c3b99d946665385b3b76e66aab96d
tree2c44febe56a1f593525d201632d42e5ec90f5b04
parent1731be4c73bb4d5bbfb4b15aaab3f183ccba6fe6
net: hns3: code optimization for hclge_rx_buffer_calc

There are four steps to calcuate the rx private buffer, each step
can be done in a function to avoid code duplication and aid code
readability.

This patch adds three separate functions do the job. Also, the
function name more or less make the comment redundant, so remove
some obvious comment.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c