Skip to content

Commit 4a8deae

Browse files
hayesorzdavem330
authored andcommitted
r8152: correct some messages
- Replace pr_warn_ratelimited() with net_ratelimit() and netdev_warn(). - Adjust the algnment of some messages. - Remove the peroid. - Fix some messages don't have terminating newline. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ecca6a9 commit 4a8deae

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

drivers/net/usb/r8152.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,12 @@ static void read_bulk_callback(struct urb *urb)
966966
case -ENOENT:
967967
return; /* the urb is in unlink state */
968968
case -ETIME:
969-
pr_warn_ratelimited("may be reset is needed?..\n");
969+
if (net_ratelimit())
970+
netdev_warn(netdev, "maybe reset is needed?\n");
970971
break;
971972
default:
972-
pr_warn_ratelimited("Rx status %d\n", status);
973+
if (net_ratelimit())
974+
netdev_warn(netdev, "Rx status %d\n", status);
973975
break;
974976
}
975977

@@ -1002,7 +1004,8 @@ static void write_bulk_callback(struct urb *urb)
10021004

10031005
stats = rtl8152_get_stats(tp->netdev);
10041006
if (status) {
1005-
pr_warn_ratelimited("Tx status %d\n", status);
1007+
if (net_ratelimit())
1008+
netdev_warn(tp->netdev, "Tx status %d\n", status);
10061009
stats->tx_errors += agg->skb_num;
10071010
} else {
10081011
stats->tx_packets += agg->skb_num;
@@ -1079,7 +1082,7 @@ static void intr_callback(struct urb *urb)
10791082
netif_device_detach(tp->netdev);
10801083
else if (res)
10811084
netif_err(tp, intr, tp->netdev,
1082-
"can't resubmit intr, status %d\n", res);
1085+
"can't resubmit intr, status %d\n", res);
10831086
}
10841087

10851088
static inline void *rx_agg_align(void *data)
@@ -1490,7 +1493,7 @@ static void rtl8152_tx_timeout(struct net_device *netdev)
14901493
struct r8152 *tp = netdev_priv(netdev);
14911494
int i;
14921495

1493-
netif_warn(tp, tx_err, netdev, "Tx timeout.\n");
1496+
netif_warn(tp, tx_err, netdev, "Tx timeout\n");
14941497
for (i = 0; i < RTL8152_MAX_TX; i++)
14951498
usb_unlink_urb(tp->tx_info[i].urb);
14961499
}
@@ -2284,8 +2287,8 @@ static int rtl8152_open(struct net_device *netdev)
22842287
if (res) {
22852288
if (res == -ENODEV)
22862289
netif_device_detach(tp->netdev);
2287-
netif_warn(tp, ifup, netdev,
2288-
"intr_urb submit failed: %d\n", res);
2290+
netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n",
2291+
res);
22892292
return res;
22902293
}
22912294

@@ -2754,7 +2757,7 @@ static int rtl8152_probe(struct usb_interface *intf,
27542757

27552758
netdev = alloc_etherdev(sizeof(struct r8152));
27562759
if (!netdev) {
2757-
dev_err(&intf->dev, "Out of memory");
2760+
dev_err(&intf->dev, "Out of memory\n");
27582761
return -ENOMEM;
27592762
}
27602763

@@ -2800,11 +2803,11 @@ static int rtl8152_probe(struct usb_interface *intf,
28002803

28012804
ret = register_netdev(netdev);
28022805
if (ret != 0) {
2803-
netif_err(tp, probe, netdev, "couldn't register the device");
2806+
netif_err(tp, probe, netdev, "couldn't register the device\n");
28042807
goto out1;
28052808
}
28062809

2807-
netif_info(tp, probe, netdev, "%s", DRIVER_VERSION);
2810+
netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION);
28082811

28092812
return 0;
28102813

0 commit comments

Comments
 (0)