warning related fixes
Subsystems (6)
cover warning related fixes
These are all patches to fix other warnings found while cleaning up netvsc driver.
Stephen Hemminger (7):
flow_dissector: make local function static
vxlan: remove unused variable
socket: make sockfs_setattr static
dcb: validate netlink attribute link
tcp_nv: make tcpnv_get_info static
ipv6: make udpv6_queue_rcv_skb static
fq_codel: fix set never used warning
drivers/net/vxlan.c | 3 +-- net/core/flow_dissector.c | 4 ++-- net/dcb/dcbnl.c | 11 +++++++---- net/ipv4/tcp_nv.c | 4 ++-- net/ipv6/udp.c | 2 +- net/sched/sch_fq_codel.c | 2 -- net/socket.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-)
Signature · 1 line
2.11.0
PATCH 1/7 flow_dissector: make local function static
Fix warning: no previous prototype for ‘skb_flow_get_be16’ Function is only used in this file, make it static.
--- net/core/flow_dissector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/flow_dissector.c +2 -2
@@ -67,8 +67,8 @@ EXPORT_SYMBOL(skb_flow_dissector_init);* The function will try to retrieve a be32 entity at * offset poff */ -__be16 skb_flow_get_be16 (const struct sk_buff *skb,int poff,void *data, -int hlen) +static __be16 skb_flow_get_be16 (const struct sk_buff *skb,int poff, +void *data,int hlen) {__be16 *u, _u;
Signature · 1 line
2.11.0
PATCH 2/7 vxlan: remove unused variable
In reply to Stephen HemmingerFix drivers/net/vxlan.c: In function ‘neigh_reduce’:
warning: variable ‘saddr’ set but not used [-Wunused-but-set-variable]
--- drivers/net/vxlan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/vxlan.c +1 -2
@@ -1553,7 +1553,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)struct vxlan_dev *vxlan =netdev_priv (dev);struct nd_msg *msg;const struct ipv6hdr *iphdr; -const struct in6_addr *saddr, *daddr; +const struct in6_addr *daddr;struct neighbour *n;struct inet6_dev *in6_dev;
@@ -1562,7 +1562,6 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) goto out; iphdr =ipv6_hdr (skb); - saddr = &iphdr->saddr; daddr = &iphdr->daddr; msg = (struct nd_msg *)skb_transport_header (skb);
Signature · 1 line
2.11.0
PATCH 3/7 socket: make sockfs_setattr static
In reply to Stephen HemmingerFix warning introduced by commit ead05568c7d5e
("net: core: Add a UID field to struct sock.")
--- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/socket.c +1 -1
@@ -531,7 +531,7 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,return used; } -int sockfs_setattr (struct dentry *dentry,struct iattr *iattr) +static int sockfs_setattr (struct dentry *dentry,struct iattr *iattr) {int err =simple_setattr (dentry, iattr);
Signature · 1 line
2.11.0
PATCH 4/7 dcb: validate netlink attribute link
In reply to Stephen HemmingerThe dcb netlink code was not validating that the IEEE_APP netlink element was correctly formed. Initially discovered because of the warning ‘dcbnl_ieee_app’ defined but not used.
This indicated that the message was not being fully validated.
Compile tested only. Do not have DCB setup.
--- net/dcb/dcbnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/dcb/dcbnl.c +7 -4
@@ -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 },
@@ -1466,8 +1462,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);
Signature · 1 line
2.11.0
PATCH 5/7 tcp_nv: make tcpnv_get_info static
In reply to Stephen HemmingerFunction only used in this file.
--- net/ipv4/tcp_nv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_nv.c +2 -2
@@ -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);
Signature · 1 line
2.11.0
PATCH 6/7 ipv6: make udpv6_queue_rcv_skb static
In reply to Stephen HemmingerOnly called once, and no prototype.
--- net/ipv6/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/udp.c +1 -1
@@ -555,7 +555,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);
Signature · 1 line
2.11.0
PATCH 7/7 fq_codel: fix set never used warning
In reply to Stephen Hemmingerprev_backlog was set in fq_codel_dequeue but never used.
--- net/sched/sch_fq_codel.c | 2 -- 1 file changed, 2 deletions(-)
net/sched/sch_fq_codel.c +0 -2
@@ -290,7 +290,6 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)struct fq_codel_flow *flow;struct list_head *head;u32 prev_drop_count, prev_ecn_mark; -unsigned int prev_backlog; begin: head = &q->new_flows;
@@ -309,7 +308,6 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch) prev_drop_count = q->cstats.drop_count; prev_ecn_mark = q->cstats.ecn_mark; - prev_backlog = sch->qstats.backlog; skb = codel_dequeue(sch, &sch->qstats.backlog, &q->cparams, &flow->cvars, &q->cstats, qdisc_pkt_len,
Signature · 1 line
2.11.0
David Miller
maintainerRe: [PATCH net-next 1/7] flow_dissector: make local function static
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Tue, 10 Jan 2017 10:18:10 -0800
Quoted 4 lines
Fix warning: no previous prototype for ‘skb_flow_get_be16’ Function is only used in this file, make it static.
Signed-off-by Stephen Hemminger <[email protected]>
Eric Dumazet already posted a patch which does this.
Re: [PATCH net-next 1/7] flow_dissector: make local function static
Quoted 9 lines · On Tue, 10 Jan 2017 13:32:01 -0500 (EST) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Tue, 10 Jan 2017 10:18:10 -0800Quoted 4 lines
Fix warning: no previous prototype for ‘skb_flow_get_be16’ Function is only used in this file, make it static.
Signed-off-by Stephen Hemminger <[email protected]>Eric Dumazet already posted a patch which does this.
Yeah it looks like several of these got posted today.
Re: [PATCH net-next 5/7] tcp_nv: make tcpnv_get_info static
In reply to Stephen HemmingerQuoted 26 lines · On 1/10/17, 10:18 AM, "[email protected] on behalf of Stephen…
Function only used in this file.
Signed-off-by Stephen Hemminger <[email protected]>---
net/ipv4/tcp_nv.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)net/ipv4/tcp_nv.c +2
-2@@ -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);Signature · 2 lines
-- 2.11.0
You should also remove the line:EXPORT_SYMBOL_GPL(tcpnv_get_info);