linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Patrick Menschel <menschel.p@posteo.de>
Cc: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>,
	linux-can <linux-can@vger.kernel.org>
Subject: Re: [PATCH] can-isotp: Add error message if txqueuelen is too small.
Date: Mon, 26 Apr 2021 20:39:37 +0200	[thread overview]
Message-ID: <20210426183937.45qvcnbc343yuecv@pengutronix.de> (raw)
In-Reply-To: <9d45b867-c1cc-76fb-9fff-59d5067e9be0@posteo.de>

[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]

On 26.04.2021 17:10:18, Patrick Menschel wrote:
> Am 26.04.21 um 01:59 schrieb Vincent MAILHOL:
> > On Mon. 26 Apr 2021 at 01:45, Patrick Menschel <menschel.p@posteo.de> wrote:
> >>
> >> Am 25.04.21 um 17:35 schrieb Vincent MAILHOL:
> >>> On Sun. 26 Apr 2021 at 00:10, Patrick Menschel <menschel.p@posteo.de> wrote:
> >>> Speaking of comprehensive error messages, it would be great to
> >>> print the mnemotechnic of the error code instead of its value:
> >>> |                       pr_notice_once("can-isotp: %s: can_send_ret
> >>> %pe : tx queue is full\n",
> >>> |                                      __func__, ERR_PTR(err));
> >>>
> >> Thanks Vincent,
> >>
> >> it's the first time I see this format string %pe , is it new or kernel
> >> specific?
> > 
> > Yes, this is fairly recent and it is kernel specific (and I love it).
> > 
> > It was added in commit 57f5677e535ba ("printf: add support for
> > printing symbolic error names").
> > Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57f5677e535ba24b8926a7125be2ef8d7f09323c
> 
> Now that is really neat, sort of like python's __member__.name attribute
> of the Enum type.
> https://docs.python.org/3/library/enum.html#allowed-members-and-attributes-of-enumerations
> I use it all the time since I moved away from ctypes.
> Saves at least 2 lines per log message.
> 
> Proves that the very nature of best practice is convenience.
> 
> I'll do a v2 and substitute for every occurrence of err in that file
> while I'm at it.

Make it two patches....what will increase you patch count :)

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2021-04-26 18:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25 15:10 [PATCH] can-isotp: Add error message if txqueuelen is too small Patrick Menschel
2021-04-25 15:35 ` Vincent MAILHOL
2021-04-25 16:45   ` Patrick Menschel
2021-04-25 23:59     ` Vincent MAILHOL
2021-04-26 17:10       ` Patrick Menschel
2021-04-26 18:39         ` Marc Kleine-Budde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210426183937.45qvcnbc343yuecv@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=menschel.p@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).