security: integrity: Use a more current logging style
authorJoe Perches <joe@perches.com>
Mon, 24 Feb 2014 21:59:56 +0000 (13:59 -0800)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 7 Mar 2014 17:15:21 +0000 (12:15 -0500)
Convert printks to pr_<level>.
Add pr_fmt.
Remove embedded prefixes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/evm/evm_crypto.c
security/integrity/evm/evm_main.c
security/integrity/evm/evm_secfs.c
security/integrity/ima/ima_crypto.c
security/integrity/ima/ima_init.c
security/integrity/ima/ima_queue.c
security/integrity/ima/ima_template.c

index 3bab89eb21d608b1123b97188234137db83869b8..9bd329f1927aa1a04b8495d5bc192f68356081ef 100644 (file)
@@ -13,6 +13,8 @@
  *      Using root's kernel master key (kmk), calculate the HMAC
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/crypto.h>
 #include <linux/xattr.h>
@@ -221,7 +223,7 @@ int evm_init_hmac(struct inode *inode, const struct xattr *lsm_xattr,
 
        desc = init_desc(EVM_XATTR_HMAC);
        if (IS_ERR(desc)) {
-               printk(KERN_INFO "init_desc failed\n");
+               pr_info("init_desc failed\n");
                return PTR_ERR(desc);
        }
 
index 336b3ddfe63f5304374f860419cd3f5251bde5b8..996092f21b64a4b71ee1a46acc49a94802e7618e 100644 (file)
@@ -14,6 +14,8 @@
  *     evm_inode_removexattr, and evm_verifyxattr
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/crypto.h>
 #include <linux/audit.h>
@@ -432,7 +434,7 @@ static int __init init_evm(void)
 
        error = evm_init_secfs();
        if (error < 0) {
-               printk(KERN_INFO "EVM: Error registering secfs\n");
+               pr_info("Error registering secfs\n");
                goto err;
        }
 
@@ -449,7 +451,7 @@ static int __init evm_display_config(void)
        char **xattrname;
 
        for (xattrname = evm_config_xattrnames; *xattrname != NULL; xattrname++)
-               printk(KERN_INFO "EVM: %s\n", *xattrname);
+               pr_info("%s\n", *xattrname);
        return 0;
 }
 
index 30f670ad6ac3a63ce98db857ad812eab144d6419..cf12a04717d32d8ab8e90d94c0aa39cc282abc3a 100644 (file)
@@ -13,6 +13,8 @@
  *     - Get the key and enable EVM
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/uaccess.h>
 #include <linux/module.h>
 #include "evm.h"
@@ -79,9 +81,9 @@ static ssize_t evm_write_key(struct file *file, const char __user *buf,
        error = evm_init_key();
        if (!error) {
                evm_initialized = 1;
-               pr_info("EVM: initialized\n");
+               pr_info("initialized\n");
        } else
-               pr_err("EVM: initialization failed\n");
+               pr_err("initialization failed\n");
        return count;
 }
 
index d8b55c95200563140da73885a7a77c93f8d891c8..99990578b7cdb6a89dd0369d46fe22cd1e78e67d 100644 (file)
@@ -13,6 +13,8 @@
  *     Calculates md5/sha1 file hash, template hash, boot-aggreate hash
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/file.h>
 #include <linux/crypto.h>
@@ -212,7 +214,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
                return;
 
        if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0)
-               pr_err("IMA: Error Communicating to TPM chip\n");
+               pr_err("Error Communicating to TPM chip\n");
 }
 
 /*
index 315f2b96496fd689e764ce6dcc03f1660b6fdb85..e8f9d70a465d11168748967928e34491f46c1765 100644 (file)
@@ -14,6 +14,9 @@
  * File: ima_init.c
  *             initialization and cleanup functions
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
@@ -93,7 +96,7 @@ int __init ima_init(void)
                ima_used_chip = 1;
 
        if (!ima_used_chip)
-               pr_info("IMA: No TPM chip found, activating TPM-bypass!\n");
+               pr_info("No TPM chip found, activating TPM-bypass!\n");
 
        rc = ima_init_crypto();
        if (rc)
index d85e99761f4fc66afa251bb2bd657062d84d9b77..91128b4b812ab317df9af0d63cbc689216ae84f9 100644 (file)
@@ -18,6 +18,9 @@
  *       The measurement list is append-only. No entry is
  *       ever removed or changed during the boot-cycle.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/rculist.h>
 #include <linux/slab.h>
@@ -72,7 +75,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry)
 
        qe = kmalloc(sizeof(*qe), GFP_KERNEL);
        if (qe == NULL) {
-               pr_err("IMA: OUT OF MEMORY ERROR creating queue entry.\n");
+               pr_err("OUT OF MEMORY ERROR creating queue entry\n");
                return -ENOMEM;
        }
        qe->entry = entry;
@@ -95,8 +98,7 @@ static int ima_pcr_extend(const u8 *hash)
 
        result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash);
        if (result != 0)
-               pr_err("IMA: Error Communicating to TPM chip, result: %d\n",
-                      result);
+               pr_err("Error Communicating to TPM chip, result: %d\n", result);
        return result;
 }
 
index 635695f6a185a1d24ee3d1bfb05d4f7ebe8cedb0..9a4a0d1826109d1537bf79d8699fa206c3e59cce 100644 (file)
@@ -12,6 +12,9 @@
  * File: ima_template.c
  *      Helpers to manage template descriptors.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <crypto/hash_info.h>
 
 #include "ima.h"
@@ -58,7 +61,7 @@ static int __init ima_template_setup(char *str)
         */
        if (template_len == 3 && strcmp(str, IMA_TEMPLATE_IMA_NAME) == 0 &&
            ima_hash_algo != HASH_ALGO_SHA1 && ima_hash_algo != HASH_ALGO_MD5) {
-               pr_err("IMA: template does not support hash alg\n");
+               pr_err("template does not support hash alg\n");
                return 1;
        }