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@xxxxxxxxx> wrote: > >> > >> Am 25.04.21 um 17:35 schrieb Vincent MAILHOL: > >>> On Sun. 26 Apr 2021 at 00:10, Patrick Menschel <menschel.p@xxxxxxxxx> 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:
signature.asc
Description: PGP signature