From: Casey Schaufler <casey@schaufler-ca.com>
To: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Cc: James Morris <james.l.morris@oracle.com>,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH 6/8] security: smack: Use a more current logging style
Date: Mon, 24 Feb 2014 14:35:25 -0800 [thread overview]
Message-ID: <530BC92D.6030509@schaufler-ca.com> (raw)
In-Reply-To: <3b69f0961dff21133e276d5c3edee8b05c41f8c5.1393279025.git.joe@perches.com>
On 2/24/2014 1:59 PM, Joe Perches wrote:
> Convert printks to pr_<level>
> Add pr_fmt.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
I will take this into the smack-next tree.
> ---
> security/smack/smack_lsm.c | 7 ++++---
> security/smack/smackfs.c | 25 +++++++++++--------------
> 2 files changed, 15 insertions(+), 17 deletions(-)
>
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 14f52be..a273aad 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -18,6 +18,8 @@
> * as published by the Free Software Foundation.
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/xattr.h>
> #include <linux/pagemap.h>
> #include <linux/mount.h>
> @@ -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);
> }
> } else
> @@ -3916,7 +3917,7 @@ static __init int smack_init(void)
> if (tsp == NULL)
> return -ENOMEM;
>
> - printk(KERN_INFO "Smack: Initializing.\n");
> + pr_info("Initializing\n");
>
> /*
> * Set the security state for the initial task.
> diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
> index 3198cfe..2e25220 100644
> --- a/security/smack/smackfs.c
> +++ b/security/smack/smackfs.c
> @@ -16,6 +16,8 @@
> *
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/kernel.h>
> #include <linux/vmalloc.h>
> #include <linux/security.h>
> @@ -698,8 +700,7 @@ static void smk_cipso_doi(void)
>
> rc = netlbl_cfg_map_del(NULL, PF_INET, NULL, NULL, &nai);
> if (rc != 0)
> - printk(KERN_WARNING "%s:%d remove rc = %d\n",
> - __func__, __LINE__, rc);
> + pr_warn("%s:%d remove rc = %d\n", __func__, __LINE__, rc);
>
> doip = kmalloc(sizeof(struct cipso_v4_doi), GFP_KERNEL);
> if (doip == NULL)
> @@ -713,15 +714,13 @@ static void smk_cipso_doi(void)
>
> rc = netlbl_cfg_cipsov4_add(doip, &nai);
> if (rc != 0) {
> - printk(KERN_WARNING "%s:%d cipso add rc = %d\n",
> - __func__, __LINE__, rc);
> + pr_warn("%s:%d cipso add rc = %d\n", __func__, __LINE__, rc);
> kfree(doip);
> return;
> }
> rc = netlbl_cfg_cipsov4_map_add(doip->doi, NULL, NULL, NULL, &nai);
> if (rc != 0) {
> - printk(KERN_WARNING "%s:%d map add rc = %d\n",
> - __func__, __LINE__, rc);
> + pr_warn("%s:%d map add rc = %d\n", __func__, __LINE__, rc);
> kfree(doip);
> return;
> }
> @@ -741,8 +740,8 @@ static void smk_unlbl_ambient(char *oldambient)
> if (oldambient != NULL) {
> rc = netlbl_cfg_map_del(oldambient, PF_INET, NULL, NULL, &nai);
> if (rc != 0)
> - printk(KERN_WARNING "%s:%d remove rc = %d\n",
> - __func__, __LINE__, rc);
> + pr_warn("%s:%d remove rc = %d\n",
> + __func__, __LINE__, rc);
> }
> if (smack_net_ambient == NULL)
> smack_net_ambient = &smack_known_floor;
> @@ -750,8 +749,7 @@ static void smk_unlbl_ambient(char *oldambient)
> rc = netlbl_cfg_unlbl_map_add(smack_net_ambient->smk_known, PF_INET,
> NULL, NULL, &nai);
> if (rc != 0)
> - printk(KERN_WARNING "%s:%d add rc = %d\n",
> - __func__, __LINE__, rc);
> + pr_warn("%s:%d add rc = %d\n", __func__, __LINE__, rc);
> }
>
> /*
> @@ -2302,8 +2300,7 @@ static int smk_fill_super(struct super_block *sb, void *data, int silent)
>
> rc = simple_fill_super(sb, SMACK_MAGIC, smack_files);
> if (rc != 0) {
> - printk(KERN_ERR "%s failed %d while creating inodes\n",
> - __func__, rc);
> + pr_err("%s failed %d while creating inodes\n", __func__, rc);
> return rc;
> }
>
> @@ -2369,13 +2366,13 @@ static int __init init_smk_fs(void)
>
> err = smk_init_sysfs();
> if (err)
> - printk(KERN_ERR "smackfs: sysfs mountpoint problem.\n");
> + pr_err("smackfs: sysfs mountpoint problem\n");
>
> err = register_filesystem(&smk_fs_type);
> if (!err) {
> smackfs_mount = kern_mount(&smk_fs_type);
> if (IS_ERR(smackfs_mount)) {
> - printk(KERN_ERR "smackfs: could not mount!\n");
> + pr_err("smackfs: could not mount!\n");
> err = PTR_ERR(smackfs_mount);
> smackfs_mount = NULL;
> }
next prev parent reply other threads:[~2014-02-24 22:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 21:59 [PATCH 0/8] security: Use a more current logging style Joe Perches
2014-02-24 21:59 ` [PATCH 1/8] " Joe Perches
2014-02-25 19:10 ` Serge Hallyn
2014-02-25 19:34 ` Joe Perches
2014-02-25 19:41 ` [PATCH V2 " Joe Perches
2014-02-24 21:59 ` [PATCH 2/8] security: apparmor: " Joe Perches
2014-02-26 7:31 ` John Johansen
2014-02-26 14:43 ` Joe Perches
2014-02-24 21:59 ` [PATCH 3/8] security: integrity: " Joe Perches
2014-02-25 2:59 ` Mimi Zohar
2014-02-24 21:59 ` [PATCH 4/8] security: keys: " Joe Perches
2014-02-24 21:59 ` [PATCH 5/8] security: selinux: " Joe Perches
2014-02-25 20:05 ` Paul Moore
2014-02-25 20:20 ` Joe Perches
2014-02-24 21:59 ` [PATCH 6/8] security: smack: " Joe Perches
2014-02-24 22:16 ` Casey Schaufler
2014-02-24 22:23 ` Joe Perches
2014-02-24 22:33 ` Casey Schaufler
2014-02-24 22:35 ` Casey Schaufler [this message]
2014-02-24 23:01 ` Casey Schaufler
2014-02-25 7:47 ` James Morris
[not found] ` <17D2BA68-5581-4326-B6DD-5EC959235B71@aol.com>
2014-02-26 0:56 ` Joe Perches
2014-02-24 22:00 ` [PATCH 7/8] security: tomoyo: " Joe Perches
2014-02-25 12:58 ` Tetsuo Handa
2014-02-24 22:00 ` [PATCH 8/8] security: yama: " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530BC92D.6030509@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=james.l.morris@oracle.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox