Skip to content

Commit f1f2b7c

Browse files
committed
Merge branch 'net-netdev_WARN_ONCE'
Gal Pressman says: ==================== Replace WARN_ONCE usages with netdev_WARN_ONCE This series will fix an issue in netdev_WARN_ONCE, improve its formatting and replace drivers' usage of WARN_ONCE to netdev_WARN_ONCE. Driver specific patches were compilation tested, in addition, functional tested on Mellanox NIC. v1->v2: - Addressed commit message comments in patch #1 ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 9f0e896 + 9d0b967 commit f1f2b7c

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,9 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp,
738738
bnx2x_gro_csum(bp, skb, bnx2x_gro_ipv6_csum);
739739
break;
740740
default:
741-
WARN_ONCE(1, "Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
742-
be16_to_cpu(skb->protocol));
741+
netdev_WARN_ONCE(bp->dev,
742+
"Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
743+
be16_to_cpu(skb->protocol));
743744
}
744745
}
745746
#endif

drivers/net/ethernet/intel/e1000/e1000_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,8 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
18381838
p = (char *)adapter + stat->stat_offset;
18391839
break;
18401840
default:
1841-
WARN_ONCE(1, "Invalid E1000 stat type: %u index %d\n",
1842-
stat->type, i);
1841+
netdev_WARN_ONCE(netdev, "Invalid E1000 stat type: %u index %d\n",
1842+
stat->type, i);
18431843
continue;
18441844
}
18451845

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
495495
mlx5_cqwq_pop(&cq->wq);
496496

497497
if (unlikely((cqe->op_own >> 4) != MLX5_CQE_REQ)) {
498-
WARN_ONCE(true, "mlx5e: Bad OP in ICOSQ CQE: 0x%x\n",
499-
cqe->op_own);
498+
netdev_WARN_ONCE(cq->channel->netdev,
499+
"Bad OP in ICOSQ CQE: 0x%x\n", cqe->op_own);
500500
return;
501501
}
502502

@@ -506,9 +506,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
506506
}
507507

508508
if (unlikely(icowi->opcode != MLX5_OPCODE_NOP))
509-
WARN_ONCE(true,
510-
"mlx5e: Bad OPCODE in ICOSQ WQE info: 0x%x\n",
511-
icowi->opcode);
509+
netdev_WARN_ONCE(cq->channel->netdev,
510+
"Bad OPCODE in ICOSQ WQE info: 0x%x\n", icowi->opcode);
512511
}
513512

514513
static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)

drivers/net/ethernet/realtek/8139cp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
748748
mss = skb_shinfo(skb)->gso_size;
749749

750750
if (mss > MSSMask) {
751-
WARN_ONCE(1, "Net bug: GSO size %d too large for 8139CP\n",
752-
mss);
751+
netdev_WARN_ONCE(dev, "Net bug: GSO size %d too large for 8139CP\n",
752+
mss);
753753
goto out_dma_error;
754754
}
755755

include/linux/netdevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4406,11 +4406,11 @@ do { \
44064406
* file/line information and a backtrace.
44074407
*/
44084408
#define netdev_WARN(dev, format, args...) \
4409-
WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \
4409+
WARN(1, "netdevice: %s%s: " format, netdev_name(dev), \
44104410
netdev_reg_state(dev), ##args)
44114411

4412-
#define netdev_WARN_ONCE(dev, condition, format, arg...) \
4413-
WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev) \
4412+
#define netdev_WARN_ONCE(dev, format, args...) \
4413+
WARN_ONCE(1, "netdevice: %s%s: " format, netdev_name(dev), \
44144414
netdev_reg_state(dev), ##args)
44154415

44164416
/* netif printk helpers, similar to netdev_printk */

0 commit comments

Comments
 (0)