Skip to content

Commit bf24e13

Browse files
JoePerchesdavem330
authored andcommitted
cavium: thunder: Remove duplicate "netdev->name" logging output
Using netdev_<level>(netdev, "%s: ...", netdev->name) duplicates the name in the output. Remove those uses. Miscellanea: o Use the netif_<level> convenience macros at the same time Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 46ccf72 commit bf24e13

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,14 @@ static void nicvf_handle_mbx_intr(struct nicvf *nic)
227227
nic->speed = mbx.link_status.speed;
228228
nic->mac_type = mbx.link_status.mac_type;
229229
if (nic->link_up) {
230-
netdev_info(nic->netdev, "%s: Link is Up %d Mbps %s\n",
231-
nic->netdev->name, nic->speed,
230+
netdev_info(nic->netdev, "Link is Up %d Mbps %s duplex\n",
231+
nic->speed,
232232
nic->duplex == DUPLEX_FULL ?
233-
"Full duplex" : "Half duplex");
233+
"Full" : "Half");
234234
netif_carrier_on(nic->netdev);
235235
netif_tx_start_all_queues(nic->netdev);
236236
} else {
237-
netdev_info(nic->netdev, "%s: Link is Down\n",
238-
nic->netdev->name);
237+
netdev_info(nic->netdev, "Link is Down\n");
239238
netif_carrier_off(nic->netdev);
240239
netif_tx_stop_all_queues(nic->netdev);
241240
}
@@ -721,8 +720,7 @@ static void nicvf_rcv_pkt_handler(struct net_device *netdev,
721720
return;
722721

723722
if (netif_msg_pktdata(nic)) {
724-
netdev_info(nic->netdev, "%s: skb 0x%p, len=%d\n", netdev->name,
725-
skb, skb->len);
723+
netdev_info(nic->netdev, "skb 0x%p, len=%d\n", skb, skb->len);
726724
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1,
727725
skb->data, skb->len, true);
728726
}
@@ -854,10 +852,8 @@ static int nicvf_cq_intr_handler(struct net_device *netdev, u8 cq_idx,
854852
netif_tx_wake_queue(txq);
855853
nic = nic->pnicvf;
856854
this_cpu_inc(nic->drv_stats->txq_wake);
857-
if (netif_msg_tx_err(nic))
858-
netdev_warn(netdev,
859-
"%s: Transmit queue wakeup SQ%d\n",
860-
netdev->name, txq_idx);
855+
netif_warn(nic, tx_err, netdev,
856+
"Transmit queue wakeup SQ%d\n", txq_idx);
861857
}
862858
}
863859

@@ -928,9 +924,8 @@ static void nicvf_handle_qs_err(unsigned long data)
928924

929925
static void nicvf_dump_intr_status(struct nicvf *nic)
930926
{
931-
if (netif_msg_intr(nic))
932-
netdev_info(nic->netdev, "%s: interrupt status 0x%llx\n",
933-
nic->netdev->name, nicvf_reg_read(nic, NIC_VF_INT));
927+
netif_info(nic, intr, nic->netdev, "interrupt status 0x%llx\n",
928+
nicvf_reg_read(nic, NIC_VF_INT));
934929
}
935930

936931
static irqreturn_t nicvf_misc_intr_handler(int irq, void *nicvf_irq)
@@ -1212,10 +1207,8 @@ static netdev_tx_t nicvf_xmit(struct sk_buff *skb, struct net_device *netdev)
12121207
netif_tx_wake_queue(txq);
12131208
} else {
12141209
this_cpu_inc(nic->drv_stats->txq_stop);
1215-
if (netif_msg_tx_err(nic))
1216-
netdev_warn(netdev,
1217-
"%s: Transmit ring full, stopping SQ%d\n",
1218-
netdev->name, qid);
1210+
netif_warn(nic, tx_err, netdev,
1211+
"Transmit ring full, stopping SQ%d\n", qid);
12191212
}
12201213
return NETDEV_TX_BUSY;
12211214
}
@@ -1600,9 +1593,7 @@ static void nicvf_tx_timeout(struct net_device *dev)
16001593
{
16011594
struct nicvf *nic = netdev_priv(dev);
16021595

1603-
if (netif_msg_tx_err(nic))
1604-
netdev_warn(dev, "%s: Transmit timed out, resetting\n",
1605-
dev->name);
1596+
netif_warn(nic, tx_err, dev, "Transmit timed out, resetting\n");
16061597

16071598
this_cpu_inc(nic->drv_stats->tx_timeout);
16081599
schedule_work(&nic->reset_task);

drivers/net/ethernet/cavium/thunder/nicvf_queues.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,11 +1811,9 @@ void nicvf_update_sq_stats(struct nicvf *nic, int sq_idx)
18111811
/* Check for errors in the receive cmp.queue entry */
18121812
int nicvf_check_cqe_rx_errs(struct nicvf *nic, struct cqe_rx_t *cqe_rx)
18131813
{
1814-
if (netif_msg_rx_err(nic))
1815-
netdev_err(nic->netdev,
1816-
"%s: RX error CQE err_level 0x%x err_opcode 0x%x\n",
1817-
nic->netdev->name,
1818-
cqe_rx->err_level, cqe_rx->err_opcode);
1814+
netif_err(nic, rx_err, nic->netdev,
1815+
"RX error CQE err_level 0x%x err_opcode 0x%x\n",
1816+
cqe_rx->err_level, cqe_rx->err_opcode);
18191817

18201818
switch (cqe_rx->err_opcode) {
18211819
case CQ_RX_ERROP_RE_PARTIAL:

0 commit comments

Comments
 (0)