[PATCH 22/49] drivers/staging/p9auth: Convert printks to pr_<level>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
 drivers/staging/p9auth/p9auth.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/p9auth/p9auth.c b/drivers/staging/p9auth/p9auth.c
index 8ccfff7..7c69e9e 100644
--- a/drivers/staging/p9auth/p9auth.c
+++ b/drivers/staging/p9auth/p9auth.c
@@ -83,8 +83,7 @@ static char *cap_hash(char *plain_text, unsigned int plain_text_size,
 
 	tfm = crypto_alloc_hash("hmac(sha1)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(tfm)) {
-		printk(KERN_ERR
-		       "failed to load transform for hmac(sha1): %ld\n",
+		pr_err("failed to load transform for hmac(sha1): %ld\n",
 		       PTR_ERR(tfm));
 		return NULL;
 	}
@@ -94,7 +93,7 @@ static char *cap_hash(char *plain_text, unsigned int plain_text_size,
 
 	result = kzalloc(MAX_DIGEST_SIZE, GFP_KERNEL);
 	if (!result) {
-		printk(KERN_ERR "out of memory!\n");
+		pr_err("out of memory!\n");
 		goto out;
 	}
 
@@ -102,7 +101,7 @@ static char *cap_hash(char *plain_text, unsigned int plain_text_size,
 
 	ret = crypto_hash_setkey(tfm, key, key_size);
 	if (ret) {
-		printk(KERN_ERR "setkey() failed ret=%d\n", ret);
+		pr_err("setkey() failed ret=%d\n", ret);
 		kfree(result);
 		result = NULL;
 		goto out;
@@ -110,7 +109,7 @@ static char *cap_hash(char *plain_text, unsigned int plain_text_size,
 
 	ret = crypto_hash_digest(&desc, &sg, plain_text_size, result);
 	if (ret) {
-		printk(KERN_ERR "digest () failed ret=%d\n", ret);
+		pr_err("digest () failed ret=%d\n", ret);
 		kfree(result);
 		result = NULL;
 		goto out;
@@ -201,7 +200,7 @@ static ssize_t cap_write(struct file *filp, const char __user *buf,
 			retval = -EINVAL;
 			goto out;
 		}
-		printk(KERN_INFO "Capability being written to /dev/caphash : \n");
+		pr_info("Capability being written to /dev/caphash : \n");
 		hexdump(user_buf, count);
 		memcpy(node_ptr->data, user_buf, count);
 		list_add(&(node_ptr->list), &(dev->head->list));
@@ -236,8 +235,8 @@ static ssize_t cap_write(struct file *filp, const char __user *buf,
 		strcat(hash_str, "@");
 		strcat(hash_str, target_user);
 
-		printk(KERN_ALERT "the source user is %s \n", source_user);
-		printk(KERN_ALERT "the target user is %s \n", target_user);
+		pr_alert("the source user is %s \n", source_user);
+		pr_alert("the target user is %s \n", target_user);
 
 		result = cap_hash(hash_str, len, rand_str, strlen(rand_str));
 		if (NULL == result) {
@@ -269,8 +268,7 @@ static ssize_t cap_write(struct file *filp, const char __user *buf,
 				 * is actually owned by the source owner
 				 */
 				if (source_int != current_uid()) {
-					printk(KERN_ALERT
-					       "Process is not owned by the source user of the capability.\n");
+					pr_alert("Process is not owned by the source user of the capability.\n");
 					retval = -EFAULT;
 					goto out;
 				}
@@ -306,8 +304,7 @@ static ssize_t cap_write(struct file *filp, const char __user *buf,
 			 * The capability is not present in the list of the
 			 * hashes stored, hence return failure
 			 */
-			printk(KERN_ALERT
-			       "Invalid capabiliy written to /dev/capuse \n");
+			pr_alert("Invalid capabiliy written to /dev/capuse \n");
 			retval = -EFAULT;
 			goto out;
 		}
@@ -357,7 +354,7 @@ static void cap_setup_cdev(struct cap_dev *dev, int index)
 	dev->cdev.ops = &cap_fops;
 	err = cdev_add(&dev->cdev, devno, 1);
 	if (err)
-		printk(KERN_NOTICE "Error %d adding cap%d", err, index);
+		pr_notice("Error %d adding cap%d", err, index);
 }
 
 static int cap_init_module(void)
@@ -375,8 +372,8 @@ static int cap_init_module(void)
 	}
 
 	if (result < 0) {
-		printk(KERN_WARNING "cap: can't get major %d\n",
-		       cap_major);
+		pr_warning("cap: can't get major %d\n",
+			   cap_major);
 		return result;
 	}
 
-- 
1.6.5.rc3.dirty

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux