Skip to content

Commit acd221a

Browse files
ubizjakkuba-moo
authored andcommitted
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: Uros Bizjak <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4f534b7 commit acd221a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,10 @@ int cxgbi_ppm_release(struct cxgbi_ppm *ppm)
342342
}
343343
EXPORT_SYMBOL(cxgbi_ppm_release);
344344

345-
static struct cxgbi_ppm_pool *ppm_alloc_cpu_pool(unsigned int *total,
346-
unsigned int *pcpu_ppmax)
345+
static struct cxgbi_ppm_pool __percpu *
346+
ppm_alloc_cpu_pool(unsigned int *total, unsigned int *pcpu_ppmax)
347347
{
348-
struct cxgbi_ppm_pool *pools;
348+
struct cxgbi_ppm_pool __percpu *pools;
349349
unsigned int ppmax = (*total) / num_possible_cpus();
350350
unsigned int max = (PCPU_MIN_UNIT_SIZE - sizeof(*pools)) << 3;
351351
unsigned int bmap;
@@ -392,7 +392,7 @@ int cxgbi_ppm_init(void **ppm_pp, struct net_device *ndev,
392392
unsigned int iscsi_edram_size)
393393
{
394394
struct cxgbi_ppm *ppm = (struct cxgbi_ppm *)(*ppm_pp);
395-
struct cxgbi_ppm_pool *pool = NULL;
395+
struct cxgbi_ppm_pool __percpu *pool = NULL;
396396
unsigned int pool_index_max = 0;
397397
unsigned int ppmax_pool = 0;
398398
unsigned int ppod_bmap_size;

0 commit comments

Comments
 (0)