]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns: fix variable used when DEBUG is defined
authorTom Rix <trix@redhat.com>
Sun, 17 Jan 2021 19:10:44 +0000 (11:10 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jan 2021 04:57:48 +0000 (20:57 -0800)
When DEBUG is defined this error occurs

drivers/net/ethernet/hisilicon/hns/hns_enet.c:1505:36: error:
  ‘struct net_device’ has no member named ‘ae_handle’;
  did you mean ‘rx_handler’?
  assert(skb->queue_mapping < ndev->ae_handle->q_num);
                                    ^~~~~~~~~

ae_handle is an element of struct hns_nic_priv, so change
ndev to priv.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20210117191044.533725-1-trix@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns/hns_enet.c

index 858cb293152a9a465ed77939431995853e107ed7..5d7824d2b4d475fb2e07f912afd197e980afdf61 100644 (file)
@@ -1502,7 +1502,7 @@ static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
 {
        struct hns_nic_priv *priv = netdev_priv(ndev);
 
-       assert(skb->queue_mapping < ndev->ae_handle->q_num);
+       assert(skb->queue_mapping < priv->ae_handle->q_num);
 
        return hns_nic_net_xmit_hw(ndev, skb,
                                   &tx_ring_data(priv, skb->queue_mapping));