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>
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to