Skip to content

Commit 8d65cd8

Browse files
edumazetdavem330
authored andcommitted
fou: remove sparse errors
We need to add __rcu qualifier to avoid these errors: net/ipv4/fou.c:250:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:250:18: expected struct net_offload const **offloads net/ipv4/fou.c:250:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:251:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:251:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:251:15: struct net_offload const * net/ipv4/fou.c:272:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:272:18: expected struct net_offload const **offloads net/ipv4/fou.c:272:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:273:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:273:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:273:15: struct net_offload const * net/ipv4/fou.c:442:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:442:18: expected struct net_offload const **offloads net/ipv4/fou.c:442:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:443:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:443:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:443:15: struct net_offload const * net/ipv4/fou.c:489:18: warning: incorrect type in assignment (different address spaces) net/ipv4/fou.c:489:18: expected struct net_offload const **offloads net/ipv4/fou.c:489:18: got struct net_offload const [noderef] __rcu ** net/ipv4/fou.c:490:15: error: incompatible types in comparison expression (different address spaces): net/ipv4/fou.c:490:15: struct net_offload const [noderef] __rcu * net/ipv4/fou.c:490:15: struct net_offload const * net/ipv4/udp_offload.c:170:26: warning: incorrect type in assignment (different address spaces) net/ipv4/udp_offload.c:170:26: expected struct net_offload const **offloads net/ipv4/udp_offload.c:170:26: got struct net_offload const [noderef] __rcu ** net/ipv4/udp_offload.c:171:23: error: incompatible types in comparison expression (different address spaces): net/ipv4/udp_offload.c:171:23: struct net_offload const [noderef] __rcu * net/ipv4/udp_offload.c:171:23: struct net_offload const * Fixes: efc98d0 ("fou: eliminate IPv4,v6 specific GRO functions") Fixes: 8bce6d7 ("udp: Generalize skb_udp_segment") Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 92548b0 commit 8d65cd8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

net/ipv4/fou.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ static struct sk_buff *fou_gro_receive(struct sock *sk,
230230
struct list_head *head,
231231
struct sk_buff *skb)
232232
{
233+
const struct net_offload __rcu **offloads;
233234
u8 proto = fou_from_sock(sk)->protocol;
234-
const struct net_offload **offloads;
235235
const struct net_offload *ops;
236236
struct sk_buff *pp = NULL;
237237

@@ -263,10 +263,10 @@ static struct sk_buff *fou_gro_receive(struct sock *sk,
263263
static int fou_gro_complete(struct sock *sk, struct sk_buff *skb,
264264
int nhoff)
265265
{
266-
const struct net_offload *ops;
266+
const struct net_offload __rcu **offloads;
267267
u8 proto = fou_from_sock(sk)->protocol;
268+
const struct net_offload *ops;
268269
int err = -ENOSYS;
269-
const struct net_offload **offloads;
270270

271271
rcu_read_lock();
272272
offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
@@ -311,7 +311,7 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
311311
struct list_head *head,
312312
struct sk_buff *skb)
313313
{
314-
const struct net_offload **offloads;
314+
const struct net_offload __rcu **offloads;
315315
const struct net_offload *ops;
316316
struct sk_buff *pp = NULL;
317317
struct sk_buff *p;
@@ -457,8 +457,8 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
457457

458458
static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff)
459459
{
460-
const struct net_offload **offloads;
461460
struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff);
461+
const struct net_offload __rcu **offloads;
462462
const struct net_offload *ops;
463463
unsigned int guehlen = 0;
464464
u8 proto;

net/ipv4/udp_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
152152
netdev_features_t features,
153153
bool is_ipv6)
154154
{
155+
const struct net_offload __rcu **offloads;
155156
__be16 protocol = skb->protocol;
156-
const struct net_offload **offloads;
157157
const struct net_offload *ops;
158158
struct sk_buff *segs = ERR_PTR(-EINVAL);
159159
struct sk_buff *(*gso_inner_segment)(struct sk_buff *skb,

0 commit comments

Comments
 (0)