Messages in this thread |  | | Subject | Re: [PATCH 6/8] security: smack: Use a more current logging style | From | Joe Perches <> | Date | Mon, 24 Feb 2014 14:23:18 -0800 |
| |
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.
> > @@ -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>
|  |