Thread (59 messages) 59 messages, 9 authors, 2014-12-20

Re: [PATCH v2 1/6] net-PPP: Replacement of a printk() call by pr_warn() in mppe_rekey()

From: Joe Perches <joe@perches.com>
Date: 2014-12-05 07:41:35
Also in: kernel-janitors, lkml

On Fri, 2014-12-05 at 08:21 +0100, Julia Lawall wrote:
On Thu, 4 Dec 2014, Joe Perches wrote:
quoted
It's generally nicer to replace embedded function names
with "%s: ", __func__

			pr_warn("%s: cipher_encrypt failed\n", __func__);
Doing so may potentially allow some strings to be shared, thus saving a 
little space.  Perhaps not in this case, though.
It's not necessarily a code size savings in any case.

It can be, but the real benefits are stylistic
consistency and lack of mismatch between function
name and message.

If the code is refactored or copy/pasted into another
function, a moderately common defect is not modifying
the embedded function name in the message.

There may be some smallish savings if ever these
__func__ uses were converted to use %pf via some
internal standardized mechanism.

A negative to that approach is inlined functions would
take the function name of the parent not keep the
inlined function name.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help