diff mbox series

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

Message ID 20240804154635.4249-1-ubizjak@gmail.com (mailing list archive)
State Accepted
Commit acd221a6507c9d936728ed297f5b1e4bcc7585ec
Delegated to: Netdev Maintainers
Headers show
Series [v2] net/chelsio/libcxgb: Add __percpu annotations to libcxgb_ppm.c | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 37 this patch: 33
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-06--00-00 (tests: 707)

Commit Message

Uros Bizjak Aug. 4, 2024, 3:46 p.m. UTC
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 <ubizjak@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
---
v2: Limit source to less than 80 columns wide.
---
 drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Horman Aug. 5, 2024, 4:45 p.m. UTC | #1
On Sun, Aug 04, 2024 at 05:46:09PM +0200, Uros Bizjak wrote:
> 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 <ubizjak@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> ---
> v2: Limit source to less than 80 columns wide.

Thanks for the update.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 7, 2024, 2:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sun,  4 Aug 2024 17:46:09 +0200 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [v2] net/chelsio/libcxgb: Add __percpu annotations to libcxgb_ppm.c
    https://git.kernel.org/netdev/net-next/c/acd221a6507c

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
index 854d87e1125c..2e3973a32d9d 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
@@ -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;