Cast between pointer to function type 'void *(*)(void *, void *)' and pointer to object type 'void *' is not allowed, fix it.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com --- v1/wd_sgl.c | 25 ++++++++++++++++++++----- wd_util.c | 7 +++++-- 2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/v1/wd_sgl.c b/v1/wd_sgl.c index ceb7f4c..a11190a 100644 --- a/v1/wd_sgl.c +++ b/v1/wd_sgl.c @@ -181,6 +181,21 @@ alloc_sgl_err: return ret; }
+static void *wd_alloc_blk_sgl(void *pool, size_t size) +{ + return wd_alloc_blk(pool); +} + +static void *wd_blk_iova_map_sgl(void *pool, void *blk, size_t sz) +{ + return wd_blk_iova_map(pool, blk); +} + +static void wd_blk_iova_unmap_sgl(void *pool, void *blk_dma, void *blk, size_t sz) +{ + wd_blk_iova_unmap(pool, blk_dma, blk); +} + static void *sgl_buf_pool_init(struct wd_queue *q, struct wd_sglpool *pool) { struct wd_sglpool_setup *sp = &pool->setup; @@ -198,11 +213,11 @@ static void *sgl_buf_pool_init(struct wd_queue *q, struct wd_sglpool *pool) return NULL; }
- pool->buf_br.alloc = (void *)wd_alloc_blk; - pool->buf_br.free = (void *)wd_free_blk; - pool->buf_br.iova_map = (void *)wd_blk_iova_map; - pool->buf_br.iova_unmap = (void *)wd_blk_iova_unmap; - pool->buf_br.get_bufsize = (void *)wd_blksize; + pool->buf_br.alloc = wd_alloc_blk_sgl; + pool->buf_br.free = wd_free_blk; + pool->buf_br.iova_map = wd_blk_iova_map_sgl; + pool->buf_br.iova_unmap = wd_blk_iova_unmap_sgl; + pool->buf_br.get_bufsize = wd_blksize; pool->buf_br.usr = p;
return p; diff --git a/wd_util.c b/wd_util.c index 053a654..370a55a 100644 --- a/wd_util.c +++ b/wd_util.c @@ -2153,7 +2153,10 @@ int wd_ctx_param_init(struct wd_ctx_params *ctx_params, return 0; }
-static void dladdr_empty(void) {} +static void dladdr_empty(void) +{ +} + int wd_get_lib_file_path(char *lib_file, char *lib_path, bool is_dir) { char file_path[PATH_MAX] = {0}; @@ -2162,7 +2165,7 @@ int wd_get_lib_file_path(char *lib_file, char *lib_path, bool is_dir) int len, rc, i;
/* Get libwd.so file's system path */ - rc = dladdr((void *)dladdr_empty, &file_info); + rc = dladdr(dladdr_empty, &file_info); if (!rc) { WD_ERR("fail to get lib file path.\n"); return -WD_EINVAL;