Skip to content

Commit

Permalink
can: isotp: change error format from decimal to symbolic error names
Browse files Browse the repository at this point in the history
This patch changes the format string for errors from decimal %d to
symbolic error names %pe to achieve more comprehensive log messages.

Link: https://lore.kernel.org/r/20210427052150.2308-2-menschel.p@posteo.de
Signed-off-by: Patrick Menschel <menschel.p@posteo.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Patrick Menschel authored and Marc Kleine-Budde committed May 27, 2021
1 parent 24a774a commit 46d8657
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus)

can_send_ret = can_send(nskb, 1);
if (can_send_ret)
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
__func__, can_send_ret);
pr_notice_once("can-isotp: %s: can_send_ret %pe\n",
__func__, ERR_PTR(can_send_ret));

dev_put(dev);

Expand Down Expand Up @@ -798,8 +798,8 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer)

can_send_ret = can_send(skb, 1);
if (can_send_ret)
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
__func__, can_send_ret);
pr_notice_once("can-isotp: %s: can_send_ret %pe\n",
__func__, ERR_PTR(can_send_ret));

if (so->tx.idx >= so->tx.len) {
/* we are done */
Expand Down Expand Up @@ -946,8 +946,8 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
err = can_send(skb, 1);
dev_put(dev);
if (err) {
pr_notice_once("can-isotp: %s: can_send_ret %d\n",
__func__, err);
pr_notice_once("can-isotp: %s: can_send_ret %pe\n",
__func__, ERR_PTR(err));
return err;
}

Expand Down

0 comments on commit 46d8657

Please sign in to comment.