net_ratelimited_function() is called to simplify code. Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index 0b7a4c3..5166a1f 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -191,8 +191,7 @@ static void peak_usb_read_bulk_callback(struct urb *urb) return; default: - if (net_ratelimit()) - netdev_err(netdev, + net_ratelimited_function(netdev_err, netdev, "Rx urb aborted (%d)\n", urb->status); goto resubmit_urb; } @@ -260,9 +259,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb) break; default: - if (net_ratelimit()) - netdev_err(netdev, "Tx urb aborted (%d)\n", - urb->status); + net_ratelimited_function(netdev_err, netdev, + "Tx urb aborted (%d)\n", urb->status); case -EPROTO: case -ENOENT: case -ECONNRESET: @@ -314,8 +312,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb, err = dev->adapter->dev_encode_msg(dev, skb, obuf, &size); if (err) { - if (net_ratelimit()) - netdev_err(netdev, "packet dropped\n"); + net_ratelimited_function(netdev_err, netdev, "packet dropped\n"); dev_kfree_skb(skb); stats->tx_dropped++; return NETDEV_TX_OK; -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html