lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/8] security: smack: Use a more current logging style
On 2/24/2014 2:23 PM, Joe Perches wrote:
> On Mon, 2014-02-24 at 14:16 -0800, Casey Schaufler wrote:
>> On 2/24/2014 1:59 PM, Joe Perches wrote:
>>> Convert printks to pr_<level>
>>> Add pr_fmt.
>>> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> []
>>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>>> +
>> What is pr_fmt() for?
> Prefixing "smack: " to the pr_<level> uses.

OK. I didn't see where it was used. I understand now. I'll go
back and ACK the changes.

>
>>> @@ -2106,8 +2108,7 @@ static int smack_inode_setsecurity(struct inode *inode, const char *name,
>>> if (sock->sk->sk_family == PF_INET) {
>>> rc = smack_netlabel(sock->sk, SMACK_CIPSO_SOCKET);
>>> if (rc != 0)
>>> - printk(KERN_WARNING
>>> - "Smack: \"%s\" netlbl error %d.\n",
>>> + pr_warn("\"%s\" netlbl error %d\n",
>>> __func__, -rc);
> This will be now be emitted as
>
> <4>smack: "smack_inode_setsecurity" netlbl error -<d>
>
> instead of
>
> <4>Smack: "smack_inode_setsecurity" netlbl error -<d>
>
> Though it'd be a lot more common to use:
>
> pr_warn("%s: netlbl error: %d\n",
> __func__, -rc);
>
> so the output would be:
>
> <4>smack: smack_inode_setsecurity: netlbl error: -<d>
>
>
>



\
 
 \ /
  Last update: 2014-02-25 00:41    [W:0.070 / U:5.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site