Re: [PATCH v2 2/2] netfilter: nf_tables: Fix percpu address space issues in nf_tables_api.c
From: Simon Horman <horms@kernel.org>
Date: 2024-08-30 17:07:15
Also in:
lkml, netfilter-devel
From: Simon Horman <horms@kernel.org>
Date: 2024-08-30 17:07:15
Also in:
lkml, netfilter-devel
On Thu, Aug 29, 2024 at 05:29:32PM +0200, Uros Bizjak wrote:
Compiling nf_tables_api.c results in several sparse warnings:
nf_tables_api.c:2077:31: warning: incorrect type in return expression (different address spaces)
nf_tables_api.c:2080:31: warning: incorrect type in return expression (different address spaces)
nf_tables_api.c:2084:31: warning: incorrect type in return expression (different address spaces)
nf_tables_api.c:2740:23: warning: incorrect type in assignment (different address spaces)
nf_tables_api.c:2752:38: warning: incorrect type in assignment (different address spaces)
nf_tables_api.c:2798:21: warning: incorrect type in argument 1 (different address spaces)
Use {ERR_PTR,IS_ERR,PTR_ERR}_PCPU() macros when crossing between generic
and percpu address spaces and add __percpu annotation to *stats pointer
to fix these warnings.
Found by GCC's named address space checks.
There were no changes in the resulting object files.
Signed-off-by: Uros Bizjak <redacted>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <redacted>
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: Also use {ERR_PTR,IS_ERR,PTR_ERR}_PCPU() macros.Reviewed-by: Simon Horman <horms@kernel.org>