提交 dd48f053 编写于 作者: Y Yunsheng Lin 提交者: Xie XiuQi

net: hns3: fix kernel-module hns compile error for 5.1

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

fix compile error because of below error:
commit 750afb08 ("cross-tree: phase out dma_zalloc_coherent()")
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Fri Jan 4 09:23:09 2019 +0100

cross-tree: phase out dma_zalloc_coherent()

We already need to zero out memory for dma_alloc_coherent(), as such
using dma_zalloc_coherent() is superfluous. Phase it out.

This change was generated with the following Coccinelle SmPL patch:

@ replace_dma_zalloc_coherent @
expression dev, size, data, handle, flags;
@@

-dma_zalloc_coherent(dev, size, handle, flags)
+dma_alloc_coherent(dev, size, handle, flags)
Suggested-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NLuis Chamberlain <mcgrof@kernel.org>
[hch: re-ran the script on the latest tree]
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4da4a5de
......@@ -7,6 +7,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/dma-direction.h>
#include "kcompat.h"
#include "hclge_cmd.h"
#include "hnae3.h"
#include "hclge_main.h"
......
......@@ -7,6 +7,7 @@
#include <linux/err.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include "kcompat.h"
#include "hclgevf_cmd.h"
#include "hclgevf_main.h"
#include "hnae3.h"
......
......@@ -403,4 +403,10 @@ static inline void linkmode_clear_bit(int nr, volatile unsigned long *addr)
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
#ifndef dma_zalloc_coherent
#define dma_zalloc_coherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#endif
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册