All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] warning cleanups
@ 2017-05-19 16:55 Stephen Hemminger
  2017-05-19 16:55 ` [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute Stephen Hemminger
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

This series addresses a number of warnings in common networking
code visible when kernel is built with W=1

The DCB patch needs review from John Fastbend the original author
of the netlink interface since it adds missing checks.

Stephen Hemminger (9):
  dcb: enforce minimum length on IEEE_APPS attribute
  ila: propagate error code in ila_output
  udp: make local function static
  inet: fix warning about missing prototype
  tcpnv: do not export local function
  xfrm: make xfrm_dev_register static
  fou: make local function static
  ipv6: drop unused variables in seg6_genl_dumphac
  ipv6: remove unused variables in esp6

 net/dcb/dcbnl.c                 | 11 ++++--
 net/ipv4/fou.c                  | 82 ++++++++++++++++++++---------------------
 net/ipv4/inet_connection_sock.c |  1 +
 net/ipv4/tcp_nv.c               |  5 +--
 net/ipv4/udp.c                  |  2 +-
 net/ipv6/esp6.c                 |  5 ---
 net/ipv6/fou6.c                 | 14 +++----
 net/ipv6/ila/ila_lwt.c          |  2 +-
 net/ipv6/seg6.c                 |  4 --
 net/ipv6/udp.c                  |  2 +-
 net/xfrm/xfrm_device.c          |  2 +-
 11 files changed, 61 insertions(+), 69 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:42   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 2/9] ila: propagate error code in ila_output Stephen Hemminger
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

Found by reviewing the warning about unused policy table.
The code implies that it meant to check for size, but since
it unrolled the loop for attribute validation that is never used.
Instead do explicit check for attribute.

Compile tested only. Needs review by original author.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/dcb/dcbnl.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 93106120f987..733f523707ac 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -178,10 +178,6 @@ static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = {
 	[DCB_ATTR_IEEE_QCN_STATS]   = {.len = sizeof(struct ieee_qcn_stats)},
 };
 
-static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + 1] = {
-	[DCB_ATTR_IEEE_APP]	    = {.len = sizeof(struct dcb_app)},
-};
-
 /* DCB number of traffic classes nested attributes. */
 static const struct nla_policy dcbnl_featcfg_nest[DCB_FEATCFG_ATTR_MAX + 1] = {
 	[DCB_FEATCFG_ATTR_ALL]      = {.type = NLA_FLAG},
@@ -1463,8 +1459,15 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
 
 		nla_for_each_nested(attr, ieee[DCB_ATTR_IEEE_APP_TABLE], rem) {
 			struct dcb_app *app_data;
+
 			if (nla_type(attr) != DCB_ATTR_IEEE_APP)
 				continue;
+
+			if (nla_len(attr) < sizeof(struct dcb_app)) {
+				err = -ERANGE;
+				goto err;
+			}
+
 			app_data = nla_data(attr);
 			if (ops->ieee_setapp)
 				err = ops->ieee_setapp(netdev, app_data);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 2/9] ila: propagate error code in ila_output
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
  2017-05-19 16:55 ` [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 3/9] udp: make local function static Stephen Hemminger
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

This warning:
net/ipv6/ila/ila_lwt.c: In function ‘ila_output’:
net/ipv6/ila/ila_lwt.c:42:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]

It looks like the code attempts to set propagate different error
values, but always returned -EINVAL.

Compile tested only. Needs review by original author.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv6/ila/ila_lwt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c
index b3df03e3faa0..f4a413aba423 100644
--- a/net/ipv6/ila/ila_lwt.c
+++ b/net/ipv6/ila/ila_lwt.c
@@ -91,7 +91,7 @@ static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 
 drop:
 	kfree_skb(skb);
-	return -EINVAL;
+	return err;
 }
 
 static int ila_input(struct sk_buff *skb)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 3/9] udp: make local function static
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
  2017-05-19 16:55 ` [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute Stephen Hemminger
  2017-05-19 16:55 ` [PATCH net-next 2/9] ila: propagate error code in ila_output Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 4/9] inet: fix warning about missing prototype Stephen Hemminger
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

udp_queue_rcv_skb was global but only used in one file.
Identified by this warning:
net/ipv4/udp.c:1775:5: warning: no previous prototype for ‘udp_queue_rcv_skb’ [-Wmissing-prototypes]
 int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv4/udp.c | 2 +-
 net/ipv6/udp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e7b6cfcca627..8d7980ca27a0 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1772,7 +1772,7 @@ EXPORT_SYMBOL(udp_encap_enable);
  * Note that in the success and error cases, the skb is assumed to
  * have either been requeued or freed.
  */
-int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 {
 	struct udp_sock *up = udp_sk(sk);
 	int is_udplite = IS_UDPLITE(sk);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f78fdf8c9f0f..d558c1fef6fd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -570,7 +570,7 @@ void udpv6_encap_enable(void)
 }
 EXPORT_SYMBOL(udpv6_encap_enable);
 
-int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+static int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 {
 	struct udp_sock *up = udp_sk(sk);
 	int is_udplite = IS_UDPLITE(sk);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 4/9] inet: fix warning about missing prototype
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (2 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 3/9] udp: make local function static Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 5/9] tcpnv: do not export local function Stephen Hemminger
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

The prototype for inet_rcv_saddr_equal was not being included.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv4/inet_connection_sock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 1054d330bf9d..82dec8825d28 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -25,6 +25,7 @@
 #include <net/xfrm.h>
 #include <net/tcp.h>
 #include <net/sock_reuseport.h>
+#include <net/addrconf.h>
 
 #ifdef INET_CSK_DEBUG
 const char inet_csk_timer_bug_msg[] = "inet_csk BUG: unknown timer value\n";
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 5/9] tcpnv: do not export local function
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (3 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 4/9] inet: fix warning about missing prototype Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 6/9] xfrm: make xfrm_dev_register static Stephen Hemminger
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

The TCP New Vegas congestion control was exporting an internal
function tcpnv_get_info which is not used by any other in tree
kernel code. Make it static.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv4/tcp_nv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_nv.c b/net/ipv4/tcp_nv.c
index 5de82a8d4d87..6d650ed3cb59 100644
--- a/net/ipv4/tcp_nv.c
+++ b/net/ipv4/tcp_nv.c
@@ -424,8 +424,8 @@ static void tcpnv_acked(struct sock *sk, const struct ack_sample *sample)
 }
 
 /* Extract info for Tcp socket info provided via netlink */
-size_t tcpnv_get_info(struct sock *sk, u32 ext, int *attr,
-		      union tcp_cc_info *info)
+static size_t tcpnv_get_info(struct sock *sk, u32 ext, int *attr,
+			     union tcp_cc_info *info)
 {
 	const struct tcpnv *ca = inet_csk_ca(sk);
 
@@ -440,7 +440,6 @@ size_t tcpnv_get_info(struct sock *sk, u32 ext, int *attr,
 	}
 	return 0;
 }
-EXPORT_SYMBOL_GPL(tcpnv_get_info);
 
 static struct tcp_congestion_ops tcpnv __read_mostly = {
 	.init		= tcpnv_init,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 6/9] xfrm: make xfrm_dev_register static
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (4 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 5/9] tcpnv: do not export local function Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-20  6:48   ` Steffen Klassert
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 7/9] fou: make local function static Stephen Hemminger
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

This function is only used in this file and should not be global.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/xfrm/xfrm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 8ec8a3fcf8d4..50ec73399b48 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -138,7 +138,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
 }
 EXPORT_SYMBOL_GPL(xfrm_dev_offload_ok);
 
-int xfrm_dev_register(struct net_device *dev)
+static int xfrm_dev_register(struct net_device *dev)
 {
 	if ((dev->features & NETIF_F_HW_ESP) && !dev->xfrmdev_ops)
 		return NOTIFY_BAD;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 7/9] fou: make local function static
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (5 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 6/9] xfrm: make xfrm_dev_register static Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac Stephen Hemminger
  2017-05-19 16:55 ` [PATCH net-next 9/9] ipv6: remove unused variables in esp6 Stephen Hemminger
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

The build header functions are not used by any other code.

net/ipv6/fou6.c:36:5: warning: no previous prototype for ‘fou6_build_header’ [-Wmissing-prototypes]
net/ipv6/fou6.c:54:5: warning: no previous prototype for ‘gue6_build_header’ [-Wmissing-prototypes]

Need to do some code rearranging to satisfy different Kconfig possiblities.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv4/fou.c  | 82 ++++++++++++++++++++++++++++-----------------------------
 net/ipv6/fou6.c | 14 +++++-----
 2 files changed, 47 insertions(+), 49 deletions(-)

diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index 805f6607f8d9..8e0257d01200 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -8,6 +8,7 @@
 #include <linux/kernel.h>
 #include <net/genetlink.h>
 #include <net/gue.h>
+#include <net/fou.h>
 #include <net/ip.h>
 #include <net/protocol.h>
 #include <net/udp.h>
@@ -859,25 +860,6 @@ size_t gue_encap_hlen(struct ip_tunnel_encap *e)
 }
 EXPORT_SYMBOL(gue_encap_hlen);
 
-static void fou_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e,
-			  struct flowi4 *fl4, u8 *protocol, __be16 sport)
-{
-	struct udphdr *uh;
-
-	skb_push(skb, sizeof(struct udphdr));
-	skb_reset_transport_header(skb);
-
-	uh = udp_hdr(skb);
-
-	uh->dest = e->dport;
-	uh->source = sport;
-	uh->len = htons(skb->len);
-	udp_set_csum(!(e->flags & TUNNEL_ENCAP_FLAG_CSUM), skb,
-		     fl4->saddr, fl4->daddr, skb->len);
-
-	*protocol = IPPROTO_UDP;
-}
-
 int __fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 		       u8 *protocol, __be16 *sport, int type)
 {
@@ -894,24 +876,6 @@ int __fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 }
 EXPORT_SYMBOL(__fou_build_header);
 
-int fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
-		     u8 *protocol, struct flowi4 *fl4)
-{
-	int type = e->flags & TUNNEL_ENCAP_FLAG_CSUM ? SKB_GSO_UDP_TUNNEL_CSUM :
-						       SKB_GSO_UDP_TUNNEL;
-	__be16 sport;
-	int err;
-
-	err = __fou_build_header(skb, e, protocol, &sport, type);
-	if (err)
-		return err;
-
-	fou_build_udp(skb, e, fl4, protocol, sport);
-
-	return 0;
-}
-EXPORT_SYMBOL(fou_build_header);
-
 int __gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 		       u8 *protocol, __be16 *sport, int type)
 {
@@ -985,8 +949,46 @@ int __gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 }
 EXPORT_SYMBOL(__gue_build_header);
 
-int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
-		     u8 *protocol, struct flowi4 *fl4)
+#ifdef CONFIG_NET_FOU_IP_TUNNELS
+
+static void fou_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e,
+			  struct flowi4 *fl4, u8 *protocol, __be16 sport)
+{
+	struct udphdr *uh;
+
+	skb_push(skb, sizeof(struct udphdr));
+	skb_reset_transport_header(skb);
+
+	uh = udp_hdr(skb);
+
+	uh->dest = e->dport;
+	uh->source = sport;
+	uh->len = htons(skb->len);
+	udp_set_csum(!(e->flags & TUNNEL_ENCAP_FLAG_CSUM), skb,
+		     fl4->saddr, fl4->daddr, skb->len);
+
+	*protocol = IPPROTO_UDP;
+}
+
+static int fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
+			    u8 *protocol, struct flowi4 *fl4)
+{
+	int type = e->flags & TUNNEL_ENCAP_FLAG_CSUM ? SKB_GSO_UDP_TUNNEL_CSUM :
+						       SKB_GSO_UDP_TUNNEL;
+	__be16 sport;
+	int err;
+
+	err = __fou_build_header(skb, e, protocol, &sport, type);
+	if (err)
+		return err;
+
+	fou_build_udp(skb, e, fl4, protocol, sport);
+
+	return 0;
+}
+
+static int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
+			    u8 *protocol, struct flowi4 *fl4)
 {
 	int type = e->flags & TUNNEL_ENCAP_FLAG_CSUM ? SKB_GSO_UDP_TUNNEL_CSUM :
 						       SKB_GSO_UDP_TUNNEL;
@@ -1001,9 +1003,7 @@ int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 
 	return 0;
 }
-EXPORT_SYMBOL(gue_build_header);
 
-#ifdef CONFIG_NET_FOU_IP_TUNNELS
 
 static const struct ip_tunnel_encap_ops fou_iptun_ops = {
 	.encap_hlen = fou_encap_hlen,
diff --git a/net/ipv6/fou6.c b/net/ipv6/fou6.c
index 9ea249b9451e..6de3c04b0f30 100644
--- a/net/ipv6/fou6.c
+++ b/net/ipv6/fou6.c
@@ -14,6 +14,8 @@
 #include <net/udp.h>
 #include <net/udp_tunnel.h>
 
+#if IS_ENABLED(CONFIG_IPV6_FOU_TUNNEL)
+
 static void fou6_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e,
 			   struct flowi6 *fl6, u8 *protocol, __be16 sport)
 {
@@ -33,8 +35,8 @@ static void fou6_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e,
 	*protocol = IPPROTO_UDP;
 }
 
-int fou6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
-		      u8 *protocol, struct flowi6 *fl6)
+static int fou6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
+			     u8 *protocol, struct flowi6 *fl6)
 {
 	__be16 sport;
 	int err;
@@ -49,10 +51,9 @@ int fou6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 
 	return 0;
 }
-EXPORT_SYMBOL(fou6_build_header);
 
-int gue6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
-		      u8 *protocol, struct flowi6 *fl6)
+static int gue6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
+			     u8 *protocol, struct flowi6 *fl6)
 {
 	__be16 sport;
 	int err;
@@ -67,9 +68,6 @@ int gue6_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
 
 	return 0;
 }
-EXPORT_SYMBOL(gue6_build_header);
-
-#if IS_ENABLED(CONFIG_IPV6_FOU_TUNNEL)
 
 static const struct ip6_tnl_encap_ops fou_ip6tun_ops = {
 	.encap_hlen = fou_encap_hlen,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (6 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 7/9] fou: make local function static Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:43   ` David Miller
  2017-05-19 16:55 ` [PATCH net-next 9/9] ipv6: remove unused variables in esp6 Stephen Hemminger
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

THe seg6_pernet_data variable was set but never used.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv6/seg6.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c
index 5f44ffed2576..15fba55e3da8 100644
--- a/net/ipv6/seg6.c
+++ b/net/ipv6/seg6.c
@@ -303,13 +303,9 @@ static int seg6_genl_dumphmac_done(struct netlink_callback *cb)
 static int seg6_genl_dumphmac(struct sk_buff *skb, struct netlink_callback *cb)
 {
 	struct rhashtable_iter *iter = (struct rhashtable_iter *)cb->args[0];
-	struct net *net = sock_net(skb->sk);
-	struct seg6_pernet_data *sdata;
 	struct seg6_hmac_info *hinfo;
 	int ret;
 
-	sdata = seg6_pernet(net);
-
 	ret = rhashtable_walk_start(iter);
 	if (ret && ret != -EAGAIN)
 		goto done;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next 9/9] ipv6: remove unused variables in esp6
  2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
                   ` (7 preceding siblings ...)
  2017-05-19 16:55 ` [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac Stephen Hemminger
@ 2017-05-19 16:55 ` Stephen Hemminger
  2017-05-21 17:44   ` David Miller
  2017-05-22 10:59   ` Steffen Klassert
  8 siblings, 2 replies; 21+ messages in thread
From: Stephen Hemminger @ 2017-05-19 16:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, Stephen Hemminger

Resolves warnings:
net/ipv6/esp6.c: In function ‘esp_ssg_unref’:
net/ipv6/esp6.c:121:10: warning: variable ‘seqhi’ set but not used [-Wunused-but-set-variable]
net/ipv6/esp6.c: In function ‘esp6_output_head’:
net/ipv6/esp6.c:227:21: warning: variable ‘esph’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 net/ipv6/esp6.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 1fe99ba8066c..53b6b870b935 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -118,7 +118,6 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,
 
 static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
 {
-	__be32 *seqhi;
 	struct crypto_aead *aead = x->data;
 	int seqhilen = 0;
 	u8 *iv;
@@ -128,7 +127,6 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
 	if (x->props.flags & XFRM_STATE_ESN)
 		seqhilen += sizeof(__be32);
 
-	seqhi = esp_tmp_seqhi(tmp);
 	iv = esp_tmp_iv(aead, tmp, seqhilen);
 	req = esp_tmp_req(aead, iv);
 
@@ -224,12 +222,9 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
 	u8 *vaddr;
 	int nfrags;
 	struct page *page;
-	struct ip_esp_hdr *esph;
 	struct sk_buff *trailer;
 	int tailen = esp->tailen;
 
-	esph = ip_esp_hdr(skb);
-
 	if (!skb_cloned(skb)) {
 		if (tailen <= skb_availroom(skb)) {
 			nfrags = 1;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 6/9] xfrm: make xfrm_dev_register static
  2017-05-19 16:55 ` [PATCH net-next 6/9] xfrm: make xfrm_dev_register static Stephen Hemminger
@ 2017-05-20  6:48   ` Steffen Klassert
  2017-05-21 17:43   ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: Steffen Klassert @ 2017-05-20  6:48 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, netdev, Stephen Hemminger

On Fri, May 19, 2017 at 09:55:53AM -0700, Stephen Hemminger wrote:
> This function is only used in this file and should not be global.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  net/xfrm/xfrm_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
> index 8ec8a3fcf8d4..50ec73399b48 100644
> --- a/net/xfrm/xfrm_device.c
> +++ b/net/xfrm/xfrm_device.c
> @@ -138,7 +138,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
>  }
>  EXPORT_SYMBOL_GPL(xfrm_dev_offload_ok);
>  
> -int xfrm_dev_register(struct net_device *dev)
> +static int xfrm_dev_register(struct net_device *dev)

I've applied a patch with this exact fix already to the
ipsec-next tree yesterday.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute
  2017-05-19 16:55 ` [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute Stephen Hemminger
@ 2017-05-21 17:42   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:42 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:48 -0700

> Found by reviewing the warning about unused policy table.
> The code implies that it meant to check for size, but since
> it unrolled the loop for attribute validation that is never used.
> Instead do explicit check for attribute.
> 
> Compile tested only. Needs review by original author.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 2/9] ila: propagate error code in ila_output
  2017-05-19 16:55 ` [PATCH net-next 2/9] ila: propagate error code in ila_output Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:49 -0700

> This warning:
> net/ipv6/ila/ila_lwt.c: In function ‘ila_output’:
> net/ipv6/ila/ila_lwt.c:42:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
> 
> It looks like the code attempts to set propagate different error
> values, but always returned -EINVAL.
> 
> Compile tested only. Needs review by original author.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 3/9] udp: make local function static
  2017-05-19 16:55 ` [PATCH net-next 3/9] udp: make local function static Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:50 -0700

> udp_queue_rcv_skb was global but only used in one file.
> Identified by this warning:
> net/ipv4/udp.c:1775:5: warning: no previous prototype for ‘udp_queue_rcv_skb’ [-Wmissing-prototypes]
>  int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Already fixed in net-next, please generate patches against
current sources.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 4/9] inet: fix warning about missing prototype
  2017-05-19 16:55 ` [PATCH net-next 4/9] inet: fix warning about missing prototype Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:51 -0700

> The prototype for inet_rcv_saddr_equal was not being included.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 5/9] tcpnv: do not export local function
  2017-05-19 16:55 ` [PATCH net-next 5/9] tcpnv: do not export local function Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:52 -0700

> The TCP New Vegas congestion control was exporting an internal
> function tcpnv_get_info which is not used by any other in tree
> kernel code. Make it static.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 6/9] xfrm: make xfrm_dev_register static
  2017-05-19 16:55 ` [PATCH net-next 6/9] xfrm: make xfrm_dev_register static Stephen Hemminger
  2017-05-20  6:48   ` Steffen Klassert
@ 2017-05-21 17:43   ` David Miller
  1 sibling, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:53 -0700

> This function is only used in this file and should not be global.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Steffen said he already took this.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 7/9] fou: make local function static
  2017-05-19 16:55 ` [PATCH net-next 7/9] fou: make local function static Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:54 -0700

> The build header functions are not used by any other code.
> 
> net/ipv6/fou6.c:36:5: warning: no previous prototype for ‘fou6_build_header’ [-Wmissing-prototypes]
> net/ipv6/fou6.c:54:5: warning: no previous prototype for ‘gue6_build_header’ [-Wmissing-prototypes]
> 
> Need to do some code rearranging to satisfy different Kconfig possiblities.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac
  2017-05-19 16:55 ` [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac Stephen Hemminger
@ 2017-05-21 17:43   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:43 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:55 -0700

> THe seg6_pernet_data variable was set but never used.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 9/9] ipv6: remove unused variables in esp6
  2017-05-19 16:55 ` [PATCH net-next 9/9] ipv6: remove unused variables in esp6 Stephen Hemminger
@ 2017-05-21 17:44   ` David Miller
  2017-05-22 10:59   ` Steffen Klassert
  1 sibling, 0 replies; 21+ messages in thread
From: David Miller @ 2017-05-21 17:44 UTC (permalink / raw)
  To: stephen; +Cc: netdev, sthemmin, steffen.klassert

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 19 May 2017 09:55:56 -0700

> Resolves warnings:
> net/ipv6/esp6.c: In function ‘esp_ssg_unref’:
> net/ipv6/esp6.c:121:10: warning: variable ‘seqhi’ set but not used [-Wunused-but-set-variable]
> net/ipv6/esp6.c: In function ‘esp6_output_head’:
> net/ipv6/esp6.c:227:21: warning: variable ‘esph’ set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Stephen please always CC: the IPSEC maintainer for IPSEC implementation
fixes.

Steffen, please consider taking this into your tree.

> ---
>  net/ipv6/esp6.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
> index 1fe99ba8066c..53b6b870b935 100644
> --- a/net/ipv6/esp6.c
> +++ b/net/ipv6/esp6.c
> @@ -118,7 +118,6 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead,
>  
>  static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
>  {
> -	__be32 *seqhi;
>  	struct crypto_aead *aead = x->data;
>  	int seqhilen = 0;
>  	u8 *iv;
> @@ -128,7 +127,6 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp)
>  	if (x->props.flags & XFRM_STATE_ESN)
>  		seqhilen += sizeof(__be32);
>  
> -	seqhi = esp_tmp_seqhi(tmp);
>  	iv = esp_tmp_iv(aead, tmp, seqhilen);
>  	req = esp_tmp_req(aead, iv);
>  
> @@ -224,12 +222,9 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info
>  	u8 *vaddr;
>  	int nfrags;
>  	struct page *page;
> -	struct ip_esp_hdr *esph;
>  	struct sk_buff *trailer;
>  	int tailen = esp->tailen;
>  
> -	esph = ip_esp_hdr(skb);
> -
>  	if (!skb_cloned(skb)) {
>  		if (tailen <= skb_availroom(skb)) {
>  			nfrags = 1;
> -- 
> 2.11.0
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next 9/9] ipv6: remove unused variables in esp6
  2017-05-19 16:55 ` [PATCH net-next 9/9] ipv6: remove unused variables in esp6 Stephen Hemminger
  2017-05-21 17:44   ` David Miller
@ 2017-05-22 10:59   ` Steffen Klassert
  1 sibling, 0 replies; 21+ messages in thread
From: Steffen Klassert @ 2017-05-22 10:59 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, netdev, Stephen Hemminger

On Fri, May 19, 2017 at 09:55:56AM -0700, Stephen Hemminger wrote:
> Resolves warnings:
> net/ipv6/esp6.c: In function ‘esp_ssg_unref’:
> net/ipv6/esp6.c:121:10: warning: variable ‘seqhi’ set but not used [-Wunused-but-set-variable]
> net/ipv6/esp6.c: In function ‘esp6_output_head’:
> net/ipv6/esp6.c:227:21: warning: variable ‘esph’ set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Applied to ipsec-next, thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-05-22 10:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 16:55 [PATCH net-next 0/9] warning cleanups Stephen Hemminger
2017-05-19 16:55 ` [PATCH net-next 1/9] dcb: enforce minimum length on IEEE_APPS attribute Stephen Hemminger
2017-05-21 17:42   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 2/9] ila: propagate error code in ila_output Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 3/9] udp: make local function static Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 4/9] inet: fix warning about missing prototype Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 5/9] tcpnv: do not export local function Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 6/9] xfrm: make xfrm_dev_register static Stephen Hemminger
2017-05-20  6:48   ` Steffen Klassert
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 7/9] fou: make local function static Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 8/9] ipv6: drop unused variables in seg6_genl_dumphac Stephen Hemminger
2017-05-21 17:43   ` David Miller
2017-05-19 16:55 ` [PATCH net-next 9/9] ipv6: remove unused variables in esp6 Stephen Hemminger
2017-05-21 17:44   ` David Miller
2017-05-22 10:59   ` Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.