aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorShlomo Pongratz <shlomop@mellanox.com>2014-01-22 08:23:29 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-23 15:59:08 -0500
commita1d0cd8ed5d315a1f2e9dec54920b73b9b30147b (patch)
treed5be1b3ce26cb7e83b82c021641c5e8303640d8b /net
parent3ad88cf70af79e6f19c4f89dd85453ba4fdf425e (diff)
net/udp_offload: Handle static checker complaints
Fixed few issues around using __rcu prefix and rcu_assign_pointer, also fixed a warning print to use ntohs(port) and not htons(port). net/ipv4/udp_offload.c:112:9: error: incompatible types in comparison expression (different address spaces) net/ipv4/udp_offload.c:113:9: error: incompatible types in comparison expression (different address spaces) net/ipv4/udp_offload.c:176:19: error: incompatible types in comparison expression (different address spaces) Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/udp_offload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index ee853c55deea..25f5cee3a08a 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -15,7 +15,7 @@
15#include <net/protocol.h> 15#include <net/protocol.h>
16 16
17static DEFINE_SPINLOCK(udp_offload_lock); 17static DEFINE_SPINLOCK(udp_offload_lock);
18static struct udp_offload_priv *udp_offload_base __read_mostly; 18static struct udp_offload_priv __rcu *udp_offload_base __read_mostly;
19 19
20struct udp_offload_priv { 20struct udp_offload_priv {
21 struct udp_offload *offload; 21 struct udp_offload *offload;
@@ -100,7 +100,7 @@ out:
100 100
101int udp_add_offload(struct udp_offload *uo) 101int udp_add_offload(struct udp_offload *uo)
102{ 102{
103 struct udp_offload_priv **head = &udp_offload_base; 103 struct udp_offload_priv __rcu **head = &udp_offload_base;
104 struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_KERNEL); 104 struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_KERNEL);
105 105
106 if (!new_offload) 106 if (!new_offload)
@@ -110,7 +110,7 @@ int udp_add_offload(struct udp_offload *uo)
110 110
111 spin_lock(&udp_offload_lock); 111 spin_lock(&udp_offload_lock);
112 rcu_assign_pointer(new_offload->next, rcu_dereference(*head)); 112 rcu_assign_pointer(new_offload->next, rcu_dereference(*head));
113 rcu_assign_pointer(*head, rcu_dereference(new_offload)); 113 rcu_assign_pointer(*head, new_offload);
114 spin_unlock(&udp_offload_lock); 114 spin_unlock(&udp_offload_lock);
115 115
116 return 0; 116 return 0;
@@ -140,7 +140,7 @@ void udp_del_offload(struct udp_offload *uo)
140 } 140 }
141 head = &uo_priv->next; 141 head = &uo_priv->next;
142 } 142 }
143 pr_warn("udp_del_offload: didn't find offload for port %d\n", htons(uo->port)); 143 pr_warn("udp_del_offload: didn't find offload for port %d\n", ntohs(uo->port));
144unlock: 144unlock:
145 spin_unlock(&udp_offload_lock); 145 spin_unlock(&udp_offload_lock);
146 if (uo_priv != NULL) 146 if (uo_priv != NULL)