linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshiaki Yamane <yamanetoshi@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org,
	Manohar Vanga <manohar.vanga@gmail.com>,
	linux-kernel@vger.kernel.org, Martyn Welch <martyn.welch@ge.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Toshiaki Yamane <yamanetoshi@gmail.com>
Subject: [PATCH 2/2] staging/vme: Use dev_ printks in vme_user.c
Date: Tue, 11 Sep 2012 16:17:03 +0900	[thread overview]
Message-ID: <1347347823-9316-1-git-send-email-yamanetoshi@gmail.com> (raw)
In-Reply-To: <1347347775-9282-1-git-send-email-yamanetoshi@gmail.com>

The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_user.c |   32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 1e3311d..206c37b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -172,7 +172,7 @@ static int vme_user_open(struct inode *inode, struct file *file)
 	mutex_lock(&image[minor].mutex);
 	/* Allow device to be opened if a resource is needed and allocated. */
 	if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
-		printk(KERN_ERR "No resources allocated for device\n");
+		dev_err(image[minor].device, "No resources allocated for device\n");
 		err = -EINVAL;
 		goto err_res;
 	}
@@ -227,13 +227,13 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count,
 			(unsigned long)copied);
 		if (retval != 0) {
 			copied = (copied - retval);
-			printk(KERN_INFO "User copy failed\n");
+			dev_info(image[minor].device, "User copy failed\n");
 			return -EINVAL;
 		}
 
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		dev_info(image[minor].device, "Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_read to do the transfer */
@@ -267,7 +267,7 @@ static ssize_t resource_from_user(unsigned int minor, const char __user *buf,
 			image[minor].kern_buf, copied, *ppos);
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		dev_info(image[minor].device, "Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_write to do the transfer */
@@ -288,7 +288,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 	retval = __copy_to_user(buf, image_ptr, (unsigned long)count);
 	if (retval != 0) {
 		retval = (count - retval);
-		printk(KERN_WARNING "Partial copy to userspace\n");
+		dev_warn(image[minor].device, "Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -307,7 +307,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
 	retval = __copy_from_user(image_ptr, buf, (unsigned long)count);
 	if (retval != 0) {
 		retval = (count - retval);
-		printk(KERN_WARNING "Partial copy to userspace\n");
+		dev_warn(image[minor].device, "Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -478,7 +478,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			copied = copy_from_user(&irq_req, argp,
 						sizeof(struct vme_irq_id));
 			if (copied != 0) {
-				printk(KERN_WARNING "Partial copy from userspace\n");
+				dev_warn(image[minor].device, "Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -505,8 +505,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			copied = copy_to_user(argp, &master,
 				sizeof(struct vme_master));
 			if (copied != 0) {
-				printk(KERN_WARNING "Partial copy to "
-					"userspace\n");
+				dev_warn(image[minor].device, "Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -517,8 +516,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 			copied = copy_from_user(&master, argp, sizeof(master));
 			if (copied != 0) {
-				printk(KERN_WARNING "Partial copy from "
-					"userspace\n");
+				dev_warn(image[minor].device, "Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -548,8 +546,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			copied = copy_to_user(argp, &slave,
 				sizeof(struct vme_slave));
 			if (copied != 0) {
-				printk(KERN_WARNING "Partial copy to "
-					"userspace\n");
+				dev_warn(image[minor].device, "Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -560,8 +557,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 			copied = copy_from_user(&slave, argp, sizeof(slave));
 			if (copied != 0) {
-				printk(KERN_WARNING "Partial copy from "
-					"userspace\n");
+				dev_warn(image[minor].device, "Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -601,8 +597,8 @@ static void buf_unalloc(int num)
 {
 	if (image[num].kern_buf) {
 #ifdef VME_DEBUG
-		printk(KERN_DEBUG "UniverseII:Releasing buffer at %p\n",
-			image[num].pci_buf);
+		dev_debug(image[num].device, "UniverseII:Releasing buffer at %p\n",
+			  image[num].pci_buf);
 #endif
 
 		vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -614,7 +610,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
 	} else {
-		printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+		dev_debug(image[num].device, "UniverseII: Buffer not allocated\n");
 #endif
 	}
 }
-- 
1.7.9.5


  reply	other threads:[~2012-09-11  7:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-21 13:00 [PATCH] staging/vme: fix checkpatch warnings Toshiaki Yamane
2012-07-23  0:53 ` Toshiaki Yamane
2012-08-17  5:04 ` [PATCH 1/5] staging/vme: fix checkpatch error Toshiaki Yamane
2012-08-17  5:05   ` [PATCH 2/5] staging/vme: fix checkpatch warning Toshiaki Yamane
2012-08-17  7:46     ` Dan Carpenter
2012-08-17  8:27       ` Toshiaki Yamane
2012-08-17 13:19         ` Greg Kroah-Hartman
2012-08-17 14:30           ` Toshiaki Yamane
2012-08-21 11:11             ` Toshiaki Yamane
2012-08-21 11:12       ` [PATCH 1/3] Staging: vme: Fix a white space issue Toshiaki Yamane
2012-08-21 11:12       ` [PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c Toshiaki Yamane
2012-09-04 20:20         ` Greg Kroah-Hartman
2012-09-11  7:16           ` [PATCH 1/2] " Toshiaki Yamane
2012-09-11  7:17             ` Toshiaki Yamane [this message]
2012-09-11 19:08               ` [PATCH 2/2] staging/vme: Use dev_ " Greg Kroah-Hartman
2012-09-11 19:08             ` [PATCH 1/2] staging/vme: Use pr_ " Greg Kroah-Hartman
2012-09-12  7:36               ` Toshiaki Yamane
2012-09-12 14:04                 ` Greg Kroah-Hartman
2012-08-21 11:13       ` [PATCH 3/3] staging/vme: Use pr_ printks in vme_pio2_core.c Toshiaki Yamane
2012-08-17  5:05   ` [PATCH 3/5] staging/vme: fix checkpatch warning Toshiaki Yamane
2012-08-17  5:05   ` [PATCH 4/5] " Toshiaki Yamane
2012-08-17  5:06   ` [PATCH 5/5] " Toshiaki Yamane

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=1347347823-9316-1-git-send-email-yamanetoshi@gmail.com \
    --to=yamanetoshi@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn.welch@ge.com \
    /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;
as well as URLs for NNTP newsgroup(s).