提交 8d8f0837 编写于 作者: B Bart Van Assche 提交者: Doug Ledford

IB/rxe: Suppress sparse warnings

Avoid that sparse complains about using 0 as a pointer, about
missing function declarations and also avoid that sparse complains
about endianness.
Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: NAndrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 69ae5439
...@@ -243,8 +243,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port, ...@@ -243,8 +243,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
{ {
int err; int err;
struct socket *sock; struct socket *sock;
struct udp_port_cfg udp_cfg = {0}; struct udp_port_cfg udp_cfg = { };
struct udp_tunnel_sock_cfg tnl_cfg = {0}; struct udp_tunnel_sock_cfg tnl_cfg = { };
if (ipv6) { if (ipv6) {
udp_cfg.family = AF_INET6; udp_cfg.family = AF_INET6;
...@@ -658,7 +658,7 @@ struct notifier_block rxe_net_notifier = { ...@@ -658,7 +658,7 @@ struct notifier_block rxe_net_notifier = {
.notifier_call = rxe_notify, .notifier_call = rxe_notify,
}; };
int rxe_net_ipv4_init(void) static int rxe_net_ipv4_init(void)
{ {
recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), false); htons(ROCE_V2_UDP_DPORT), false);
...@@ -671,7 +671,7 @@ int rxe_net_ipv4_init(void) ...@@ -671,7 +671,7 @@ int rxe_net_ipv4_init(void)
return 0; return 0;
} }
int rxe_net_ipv6_init(void) static int rxe_net_ipv6_init(void)
{ {
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
......
...@@ -389,7 +389,7 @@ int rxe_rcv(struct sk_buff *skb) ...@@ -389,7 +389,7 @@ int rxe_rcv(struct sk_buff *skb)
calc_icrc = rxe_icrc_hdr(pkt, skb); calc_icrc = rxe_icrc_hdr(pkt, skb);
calc_icrc = crc32_le(calc_icrc, (u8 *)payload_addr(pkt), calc_icrc = crc32_le(calc_icrc, (u8 *)payload_addr(pkt),
payload_size(pkt)); payload_size(pkt));
calc_icrc = cpu_to_be32(~calc_icrc); calc_icrc = (__force u32)cpu_to_be32(~calc_icrc);
if (unlikely(calc_icrc != pack_icrc)) { if (unlikely(calc_icrc != pack_icrc)) {
if (skb->protocol == htons(ETH_P_IPV6)) if (skb->protocol == htons(ETH_P_IPV6))
pr_warn_ratelimited("bad ICRC from %pI6c\n", pr_warn_ratelimited("bad ICRC from %pI6c\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册