Commit acd221a6 authored by Uros Bizjak's avatar Uros Bizjak Committed by Jakub Kicinski

net/chelsio/libcxgb: Add __percpu annotations to libcxgb_ppm.c

Compiling libcxgb_ppm.c results in several sparse warnings:

libcxgb_ppm.c:368:15: warning: incorrect type in assignment (different address spaces)
libcxgb_ppm.c:368:15:    expected struct cxgbi_ppm_pool *pools
libcxgb_ppm.c:368:15:    got void [noderef] __percpu *_res
libcxgb_ppm.c:374:48: warning: incorrect type in initializer (different address spaces)
libcxgb_ppm.c:374:48:    expected void const [noderef] __percpu *__vpp_verify
libcxgb_ppm.c:374:48:    got struct cxgbi_ppm_pool *
libcxgb_ppm.c:484:19: warning: incorrect type in assignment (different address spaces)
libcxgb_ppm.c:484:19:    expected struct cxgbi_ppm_pool [noderef] __percpu *pool
libcxgb_ppm.c:484:19:    got struct cxgbi_ppm_pool *[assigned] pool
libcxgb_ppm.c:511:21: warning: incorrect type in argument 1 (different address spaces)
libcxgb_ppm.c:511:21:    expected void [noderef] __percpu *__pdata
libcxgb_ppm.c:511:21:    got struct cxgbi_ppm_pool *[assigned] pool

Add __percpu annotation to *pools and *pool percpu pointers and to
ppm_alloc_cpu_pool() function that returns percpu pointer to fix
these warnings.

Compile tested only, but there is no difference in the resulting object file.
Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240804154635.4249-1-ubizjak@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4f534b7f
......@@ -342,10 +342,10 @@ int cxgbi_ppm_release(struct cxgbi_ppm *ppm)
}
EXPORT_SYMBOL(cxgbi_ppm_release);
static struct cxgbi_ppm_pool *ppm_alloc_cpu_pool(unsigned int *total,
unsigned int *pcpu_ppmax)
static struct cxgbi_ppm_pool __percpu *
ppm_alloc_cpu_pool(unsigned int *total, unsigned int *pcpu_ppmax)
{
struct cxgbi_ppm_pool *pools;
struct cxgbi_ppm_pool __percpu *pools;
unsigned int ppmax = (*total) / num_possible_cpus();
unsigned int max = (PCPU_MIN_UNIT_SIZE - sizeof(*pools)) << 3;
unsigned int bmap;
......@@ -392,7 +392,7 @@ int cxgbi_ppm_init(void **ppm_pp, struct net_device *ndev,
unsigned int iscsi_edram_size)
{
struct cxgbi_ppm *ppm = (struct cxgbi_ppm *)(*ppm_pp);
struct cxgbi_ppm_pool *pool = NULL;
struct cxgbi_ppm_pool __percpu *pool = NULL;
unsigned int pool_index_max = 0;
unsigned int ppmax_pool = 0;
unsigned int ppod_bmap_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment