Commit 51e3ea3f authored by David S. Miller's avatar David S. Miller

Merge branch 'net-warnings'

Stephen Hemminger says:

====================
network related warning fixes

Various fixes for warnings in network code and drivers.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 447e9ebf ce7426ca
...@@ -5628,12 +5628,10 @@ void bnxt_tx_disable(struct bnxt *bp) ...@@ -5628,12 +5628,10 @@ void bnxt_tx_disable(struct bnxt *bp)
{ {
int i; int i;
struct bnxt_tx_ring_info *txr; struct bnxt_tx_ring_info *txr;
struct netdev_queue *txq;
if (bp->tx_ring) { if (bp->tx_ring) {
for (i = 0; i < bp->tx_nr_rings; i++) { for (i = 0; i < bp->tx_nr_rings; i++) {
txr = &bp->tx_ring[i]; txr = &bp->tx_ring[i];
txq = netdev_get_tx_queue(bp->dev, i);
txr->dev_state = BNXT_DEV_STATE_CLOSING; txr->dev_state = BNXT_DEV_STATE_CLOSING;
} }
} }
...@@ -5646,11 +5644,9 @@ void bnxt_tx_enable(struct bnxt *bp) ...@@ -5646,11 +5644,9 @@ void bnxt_tx_enable(struct bnxt *bp)
{ {
int i; int i;
struct bnxt_tx_ring_info *txr; struct bnxt_tx_ring_info *txr;
struct netdev_queue *txq;
for (i = 0; i < bp->tx_nr_rings; i++) { for (i = 0; i < bp->tx_nr_rings; i++) {
txr = &bp->tx_ring[i]; txr = &bp->tx_ring[i];
txq = netdev_get_tx_queue(bp->dev, i);
txr->dev_state = 0; txr->dev_state = 0;
} }
netif_tx_wake_all_queues(bp->dev); netif_tx_wake_all_queues(bp->dev);
......
...@@ -523,7 +523,7 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd) ...@@ -523,7 +523,7 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
struct flow_keys *fkeys; struct flow_keys *fkeys;
int i, rc = -EINVAL; int i, rc = -EINVAL;
if (fs->location < 0 || fs->location >= BNXT_NTP_FLTR_MAX_FLTR) if (fs->location >= BNXT_NTP_FLTR_MAX_FLTR)
return rc; return rc;
for (i = 0; i < BNXT_NTP_FLTR_HASH_SIZE; i++) { for (i = 0; i < BNXT_NTP_FLTR_HASH_SIZE; i++) {
......
...@@ -139,10 +139,7 @@ int be_roce_register_driver(struct ocrdma_driver *drv) ...@@ -139,10 +139,7 @@ int be_roce_register_driver(struct ocrdma_driver *drv)
} }
ocrdma_drv = drv; ocrdma_drv = drv;
list_for_each_entry(dev, &be_adapter_list, entry) { list_for_each_entry(dev, &be_adapter_list, entry) {
struct net_device *netdev;
_be_roce_dev_add(dev); _be_roce_dev_add(dev);
netdev = dev->netdev;
} }
mutex_unlock(&be_adapter_list_lock); mutex_unlock(&be_adapter_list_lock);
return 0; return 0;
......
...@@ -273,9 +273,6 @@ static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev, ...@@ -273,9 +273,6 @@ static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev,
struct lowpan_peer *peer) struct lowpan_peer *peer)
{ {
const u8 *saddr; const u8 *saddr;
struct lowpan_btle_dev *dev;
dev = lowpan_btle_dev(netdev);
saddr = peer->lladdr; saddr = peer->lladdr;
......
...@@ -106,7 +106,7 @@ static DEFINE_SPINLOCK(recent_lock); ...@@ -106,7 +106,7 @@ static DEFINE_SPINLOCK(recent_lock);
static DEFINE_MUTEX(recent_mutex); static DEFINE_MUTEX(recent_mutex);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static const struct file_operations recent_old_fops, recent_mt_fops; static const struct file_operations recent_mt_fops;
#endif #endif
static u_int32_t hash_rnd __read_mostly; static u_int32_t hash_rnd __read_mostly;
......
...@@ -3404,7 +3404,6 @@ u32 kernel_sock_ip_overhead(struct sock *sk) ...@@ -3404,7 +3404,6 @@ u32 kernel_sock_ip_overhead(struct sock *sk)
struct inet_sock *inet; struct inet_sock *inet;
struct ip_options_rcu *opt; struct ip_options_rcu *opt;
u32 overhead = 0; u32 overhead = 0;
bool owned_by_user;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
struct ipv6_pinfo *np; struct ipv6_pinfo *np;
struct ipv6_txoptions *optv6 = NULL; struct ipv6_txoptions *optv6 = NULL;
...@@ -3413,13 +3412,12 @@ u32 kernel_sock_ip_overhead(struct sock *sk) ...@@ -3413,13 +3412,12 @@ u32 kernel_sock_ip_overhead(struct sock *sk)
if (!sk) if (!sk)
return overhead; return overhead;
owned_by_user = sock_owned_by_user(sk);
switch (sk->sk_family) { switch (sk->sk_family) {
case AF_INET: case AF_INET:
inet = inet_sk(sk); inet = inet_sk(sk);
overhead += sizeof(struct iphdr); overhead += sizeof(struct iphdr);
opt = rcu_dereference_protected(inet->inet_opt, opt = rcu_dereference_protected(inet->inet_opt,
owned_by_user); sock_owned_by_user(sk));
if (opt) if (opt)
overhead += opt->opt.optlen; overhead += opt->opt.optlen;
return overhead; return overhead;
...@@ -3429,7 +3427,7 @@ u32 kernel_sock_ip_overhead(struct sock *sk) ...@@ -3429,7 +3427,7 @@ u32 kernel_sock_ip_overhead(struct sock *sk)
overhead += sizeof(struct ipv6hdr); overhead += sizeof(struct ipv6hdr);
if (np) if (np)
optv6 = rcu_dereference_protected(np->opt, optv6 = rcu_dereference_protected(np->opt,
owned_by_user); sock_owned_by_user(sk));
if (optv6) if (optv6)
overhead += (optv6->opt_flen + optv6->opt_nflen); overhead += (optv6->opt_flen + optv6->opt_nflen);
return overhead; return overhead;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment