linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/vme: fix checkpatch warnings
@ 2012-07-21 13:00 Toshiaki Yamane
  2012-07-23  0:53 ` Toshiaki Yamane
  2012-08-17  5:04 ` [PATCH 1/5] staging/vme: fix checkpatch error Toshiaki Yamane
  0 siblings, 2 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-07-21 13:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

Now checkpatch clean.

$ find drivers/staging/vme -name "*.[ch]"|xargs ./scripts/checkpatch.pl \
-f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n
      1  ERROR: trailing whitespace
      2  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
      5  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
      7  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
      9  WARNING: quoted string split across lines
     13  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c |    9 ++--
 drivers/staging/vme/devices/vme_user.c      |   70 ++++++++++++---------------
 2 files changed, 35 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..b5f942a 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -163,15 +163,14 @@ static int __init pio2_init(void)
 	int retval = 0;
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("%s: No cards, skipping registration\n",
+		       driver_name);
 		goto err_nocard;
 	}
 
 	if (bus_num > PIO2_CARDS_MAX) {
-		printk(KERN_ERR
-			"%s: Driver only able to handle %d PIO2 Cards\n",
-			driver_name, PIO2_CARDS_MAX);
+		pr_err("%s: Driver only able to handle %d PIO2 Cards\n",
+		       driver_name, PIO2_CARDS_MAX);
 		bus_num = PIO2_CARDS_MAX;
 	}
 
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e25645e..1c82938 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -170,7 +170,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");
+		pr_err("No resources allocated for device\n");
 		err = -EINVAL;
 		goto err_res;
 	}
@@ -225,13 +225,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");
+			pr_info("User copy failed\n");
 			return -EINVAL;
 		}
 
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_read to do the transfer */
@@ -265,7 +265,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");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_write to do the transfer */
@@ -286,7 +286,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -305,7 +305,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -396,7 +396,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	default:
 		retval = -EINVAL;
 	}
-	
+
 	mutex_unlock(&image[minor].mutex);
 
 	if (retval > 0)
@@ -476,7 +476,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -503,8 +503,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -515,8 +514,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -546,8 +544,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -558,8 +555,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -599,8 +595,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);
+		pr_debug("UniverseII:Releasing buffer at %p\n",
+			 image[num].pci_buf);
 #endif
 
 		vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -612,7 +608,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
 	} else {
-		printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+		pr_debug("UniverseII: Buffer not allocated\n");
 #endif
 	}
 }
@@ -629,11 +625,11 @@ static int __init vme_user_init(void)
 {
 	int retval = 0;
 
-	printk(KERN_INFO "VME User Space Access Driver\n");
+	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("%s: No cards, skipping registration\n",
+		       driver_name);
 		retval = -ENODEV;
 		goto err_nocard;
 	}
@@ -642,8 +638,8 @@ static int __init vme_user_init(void)
 	 * in future revisions if that ever becomes necessary.
 	 */
 	if (bus_num > VME_USER_BUS_MAX) {
-		printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-			driver_name, VME_USER_BUS_MAX);
+		pr_err("%s: Driver only able to handle %d buses\n",
+		       driver_name, VME_USER_BUS_MAX);
 		bus_num = VME_USER_BUS_MAX;
 	}
 
@@ -683,8 +679,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
 	/* Save pointer to the bridge device */
 	if (vme_user_bridge != NULL) {
-		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-			driver_name);
+		pr_err("%s: Driver can only be loaded for 1 device\n",
+		       driver_name);
 		err = -EINVAL;
 		goto err_dev;
 	}
@@ -707,8 +703,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
 		driver_name);
 	if (err) {
-		printk(KERN_WARNING "%s: Error getting Major Number %d for "
-		"driver.\n", driver_name, VME_MAJOR);
+		pr_warn("%s: Error getting Major Number %d for driver.\n",
+			driver_name, VME_MAJOR);
 		goto err_region;
 	}
 
@@ -718,7 +714,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	vme_user_cdev->owner = THIS_MODULE;
 	err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
 	if (err) {
-		printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+		pr_warn("%s: cdev_all failed\n", driver_name);
 		goto err_char;
 	}
 
@@ -732,16 +728,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate slave "
-				"resource\n");
+			pr_warn("Unable to allocate slave resource\n");
 			goto err_slave;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"buffer\n");
+			pr_warn("Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
 			vme_slave_free(image[i].resource);
 			err = -ENOMEM;
@@ -758,15 +752,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate master "
-				"resource\n");
+			pr_warn("Unable to allocate master resource\n");
 			goto err_master;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"master window buffers\n");
+			pr_warn("Unable to allocate memory for master window buffers\n");
 			err = -ENOMEM;
 			goto err_master_buf;
 		}
@@ -775,7 +767,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	/* Create sysfs entries - on udev systems this creates the dev files */
 	vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
 	if (IS_ERR(vme_user_sysfs_class)) {
-		printk(KERN_ERR "Error creating vme_user class.\n");
+		pr_err("Error creating vme_user class.\n");
 		err = PTR_ERR(vme_user_sysfs_class);
 		goto err_class;
 	}
@@ -803,7 +795,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].device = device_create(vme_user_sysfs_class, NULL,
 					MKDEV(VME_MAJOR, i), NULL, name, num);
 		if (IS_ERR(image[i].device)) {
-			printk(KERN_INFO "%s: Error creating sysfs device\n",
+			pr_info("%s: Error creating sysfs device\n",
 				driver_name);
 			err = PTR_ERR(image[i].device);
 			goto err_sysfs;
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] staging/vme: fix checkpatch warnings
  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
  1 sibling, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-07-23  0:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

Now checkpatch clean.

$ find drivers/staging/vme -name "*.[ch]"|xargs ./scripts/checkpatch.pl \
-f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n
      1  ERROR: trailing whitespace
      2  WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
      5  WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
      7  WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
      9  WARNING: quoted string split across lines
     13  WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c |   10 ++--
 drivers/staging/vme/devices/vme_user.c      |   71 ++++++++++++---------------
 2 files changed, 36 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..dad8281 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -10,6 +10,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -163,15 +165,13 @@ static int __init pio2_init(void)
 	int retval = 0;
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		goto err_nocard;
 	}
 
 	if (bus_num > PIO2_CARDS_MAX) {
-		printk(KERN_ERR
-			"%s: Driver only able to handle %d PIO2 Cards\n",
-			driver_name, PIO2_CARDS_MAX);
+		pr_err("Driver only able to handle %d PIO2 Cards\n",
+		       PIO2_CARDS_MAX);
 		bus_num = PIO2_CARDS_MAX;
 	}
 
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e25645e..7d28086 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -170,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");
+		pr_err("No resources allocated for device\n");
 		err = -EINVAL;
 		goto err_res;
 	}
@@ -225,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");
+			pr_info("User copy failed\n");
 			return -EINVAL;
 		}
 
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_read to do the transfer */
@@ -265,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");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_write to do the transfer */
@@ -286,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -305,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -396,7 +398,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	default:
 		retval = -EINVAL;
 	}
-	
+
 	mutex_unlock(&image[minor].mutex);
 
 	if (retval > 0)
@@ -476,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -503,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -515,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -546,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -558,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -599,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);
+		pr_debug("UniverseII:Releasing buffer at %p\n",
+			 image[num].pci_buf);
 #endif
 
 		vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -612,7 +610,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
 	} else {
-		printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+		pr_debug("UniverseII: Buffer not allocated\n");
 #endif
 	}
 }
@@ -629,11 +627,10 @@ static int __init vme_user_init(void)
 {
 	int retval = 0;
 
-	printk(KERN_INFO "VME User Space Access Driver\n");
+	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		retval = -ENODEV;
 		goto err_nocard;
 	}
@@ -642,8 +639,8 @@ static int __init vme_user_init(void)
 	 * in future revisions if that ever becomes necessary.
 	 */
 	if (bus_num > VME_USER_BUS_MAX) {
-		printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-			driver_name, VME_USER_BUS_MAX);
+		pr_err("Driver only able to handle %d buses\n",
+		       VME_USER_BUS_MAX);
 		bus_num = VME_USER_BUS_MAX;
 	}
 
@@ -683,8 +680,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
 	/* Save pointer to the bridge device */
 	if (vme_user_bridge != NULL) {
-		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-			driver_name);
+		pr_err("Driver can only be loaded for 1 device\n");
 		err = -EINVAL;
 		goto err_dev;
 	}
@@ -707,8 +703,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
 		driver_name);
 	if (err) {
-		printk(KERN_WARNING "%s: Error getting Major Number %d for "
-		"driver.\n", driver_name, VME_MAJOR);
+		pr_warn("Error getting Major Number %d for driver.\n",
+			VME_MAJOR);
 		goto err_region;
 	}
 
@@ -718,7 +714,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	vme_user_cdev->owner = THIS_MODULE;
 	err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
 	if (err) {
-		printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+		pr_warn("cdev_all failed\n");
 		goto err_char;
 	}
 
@@ -732,16 +728,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate slave "
-				"resource\n");
+			pr_warn("Unable to allocate slave resource\n");
 			goto err_slave;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"buffer\n");
+			pr_warn("Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
 			vme_slave_free(image[i].resource);
 			err = -ENOMEM;
@@ -758,15 +752,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate master "
-				"resource\n");
+			pr_warn("Unable to allocate master resource\n");
 			goto err_master;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"master window buffers\n");
+			pr_warn("Unable to allocate memory for master window buffers\n");
 			err = -ENOMEM;
 			goto err_master_buf;
 		}
@@ -775,7 +767,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	/* Create sysfs entries - on udev systems this creates the dev files */
 	vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
 	if (IS_ERR(vme_user_sysfs_class)) {
-		printk(KERN_ERR "Error creating vme_user class.\n");
+		pr_err("Error creating vme_user class.\n");
 		err = PTR_ERR(vme_user_sysfs_class);
 		goto err_class;
 	}
@@ -803,8 +795,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].device = device_create(vme_user_sysfs_class, NULL,
 					MKDEV(VME_MAJOR, i), NULL, name, num);
 		if (IS_ERR(image[i].device)) {
-			printk(KERN_INFO "%s: Error creating sysfs device\n",
-				driver_name);
+			pr_info("Error creating sysfs device\n");
 			err = PTR_ERR(image[i].device);
 			goto err_sysfs;
 		}
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 1/5] staging/vme: fix checkpatch error
  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 ` Toshiaki Yamane
  2012-08-17  5:05   ` [PATCH 2/5] staging/vme: fix checkpatch warning Toshiaki Yamane
                     ` (3 more replies)
  1 sibling, 4 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  5:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

The below checkpatch error was fixed.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e25645e..e39d273 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -396,7 +396,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	default:
 		retval = -EINVAL;
 	}
-	
+
 	mutex_unlock(&image[minor].mutex);
 
 	if (retval > 0)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/5] staging/vme: fix checkpatch warning
  2012-08-17  5:04 ` [PATCH 1/5] staging/vme: fix checkpatch error Toshiaki Yamane
@ 2012-08-17  5:05   ` Toshiaki Yamane
  2012-08-17  7:46     ` Dan Carpenter
  2012-08-17  5:05   ` [PATCH 3/5] staging/vme: fix checkpatch warning Toshiaki Yamane
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  5:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

The below checkpatch warnings was fixed,

-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

and added pr_fmt.

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e39d273..f12945c 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -225,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");
+			pr_info("User copy failed\n");
 			return -EINVAL;
 		}
 
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_read to do the transfer */
@@ -265,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");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_write to do the transfer */
@@ -629,7 +631,7 @@ static int __init vme_user_init(void)
 {
 	int retval = 0;
 
-	printk(KERN_INFO "VME User Space Access Driver\n");
+	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
 		printk(KERN_ERR "%s: No cards, skipping registration\n",
@@ -803,8 +805,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].device = device_create(vme_user_sysfs_class, NULL,
 					MKDEV(VME_MAJOR, i), NULL, name, num);
 		if (IS_ERR(image[i].device)) {
-			printk(KERN_INFO "%s: Error creating sysfs device\n",
-				driver_name);
+			pr_info("Error creating sysfs device\n");
 			err = PTR_ERR(image[i].device);
 			goto err_sysfs;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/5] staging/vme: fix checkpatch warning
  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  5:05   ` Toshiaki Yamane
  2012-08-17  5:05   ` [PATCH 4/5] " Toshiaki Yamane
  2012-08-17  5:06   ` [PATCH 5/5] " Toshiaki Yamane
  3 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  5:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

The below checkpatch warnings was fixed.

-WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index f12945c..ef4b821 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -601,8 +601,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);
+		pr_debug("UniverseII:Releasing buffer at %p\n",
+			 image[num].pci_buf);
 #endif
 
 		vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -614,7 +614,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
 	} else {
-		printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+		pr_debug("UniverseII: Buffer not allocated\n");
 #endif
 	}
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/5] staging/vme: fix checkpatch warning
  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  5:05   ` [PATCH 3/5] staging/vme: fix checkpatch warning Toshiaki Yamane
@ 2012-08-17  5:05   ` Toshiaki Yamane
  2012-08-17  5:06   ` [PATCH 5/5] " Toshiaki Yamane
  3 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  5:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

The below checkpatch warnings was fixed.

-WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index ef4b821..e47fc41 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -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");
+		pr_warn("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");
+		pr_warn("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");
+				pr_warn("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");
+				pr_warn("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");
+				pr_warn("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");
+				pr_warn("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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -709,8 +705,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
 		driver_name);
 	if (err) {
-		printk(KERN_WARNING "%s: Error getting Major Number %d for "
-		"driver.\n", driver_name, VME_MAJOR);
+		pr_warn("Error getting Major Number %d for driver.\n",
+			VME_MAJOR);
 		goto err_region;
 	}
 
@@ -720,7 +716,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	vme_user_cdev->owner = THIS_MODULE;
 	err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
 	if (err) {
-		printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+		pr_warn("cdev_all failed\n");
 		goto err_char;
 	}
 
@@ -734,16 +730,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate slave "
-				"resource\n");
+			pr_warn("Unable to allocate slave resource\n");
 			goto err_slave;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"buffer\n");
+			pr_warn("Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
 			vme_slave_free(image[i].resource);
 			err = -ENOMEM;
@@ -760,15 +754,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate master "
-				"resource\n");
+			pr_warn("Unable to allocate master resource\n");
 			goto err_master;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"master window buffers\n");
+			pr_warn("Unable to allocate memory for master window buffers\n");
 			err = -ENOMEM;
 			goto err_master_buf;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/5] staging/vme: fix checkpatch warning
  2012-08-17  5:04 ` [PATCH 1/5] staging/vme: fix checkpatch error Toshiaki Yamane
                     ` (2 preceding siblings ...)
  2012-08-17  5:05   ` [PATCH 4/5] " Toshiaki Yamane
@ 2012-08-17  5:06   ` Toshiaki Yamane
  3 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  5:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel
  Cc: Toshiaki Yamane

The below checkpatch warnings was fixed,

-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c |   10 +++++-----
 drivers/staging/vme/devices/vme_user.c      |   14 ++++++--------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..dad8281 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -10,6 +10,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -163,15 +165,13 @@ static int __init pio2_init(void)
 	int retval = 0;
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		goto err_nocard;
 	}
 
 	if (bus_num > PIO2_CARDS_MAX) {
-		printk(KERN_ERR
-			"%s: Driver only able to handle %d PIO2 Cards\n",
-			driver_name, PIO2_CARDS_MAX);
+		pr_err("Driver only able to handle %d PIO2 Cards\n",
+		       PIO2_CARDS_MAX);
 		bus_num = PIO2_CARDS_MAX;
 	}
 
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e47fc41..7d28086 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");
+		pr_err("No resources allocated for device\n");
 		err = -EINVAL;
 		goto err_res;
 	}
@@ -630,8 +630,7 @@ static int __init vme_user_init(void)
 	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		retval = -ENODEV;
 		goto err_nocard;
 	}
@@ -640,8 +639,8 @@ static int __init vme_user_init(void)
 	 * in future revisions if that ever becomes necessary.
 	 */
 	if (bus_num > VME_USER_BUS_MAX) {
-		printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-			driver_name, VME_USER_BUS_MAX);
+		pr_err("Driver only able to handle %d buses\n",
+		       VME_USER_BUS_MAX);
 		bus_num = VME_USER_BUS_MAX;
 	}
 
@@ -681,8 +680,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
 	/* Save pointer to the bridge device */
 	if (vme_user_bridge != NULL) {
-		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-			driver_name);
+		pr_err("Driver can only be loaded for 1 device\n");
 		err = -EINVAL;
 		goto err_dev;
 	}
@@ -769,7 +767,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	/* Create sysfs entries - on udev systems this creates the dev files */
 	vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
 	if (IS_ERR(vme_user_sysfs_class)) {
-		printk(KERN_ERR "Error creating vme_user class.\n");
+		pr_err("Error creating vme_user class.\n");
 		err = PTR_ERR(vme_user_sysfs_class);
 		goto err_class;
 	}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] staging/vme: fix checkpatch warning
  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
                         ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Dan Carpenter @ 2012-08-17  7:46 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel

You've got the same subject repeated 5 times.

It would be better to merge all the vme_user.c printk fixes into
one patch.
[patch 1/3] Staging: vme: Fix a white space issue
[patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
[patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c

It's not a huge deal, it just seems like there was some confusion on
how to break patches up.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] staging/vme: fix checkpatch warning
  2012-08-17  7:46     ` Dan Carpenter
@ 2012-08-17  8:27       ` Toshiaki Yamane
  2012-08-17 13:19         ` Greg Kroah-Hartman
  2012-08-21 11:12       ` [PATCH 1/3] Staging: vme: Fix a white space issue Toshiaki Yamane
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17  8:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Martyn Welch, Manohar Vanga, devel, linux-kernel

On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> You've got the same subject repeated 5 times.
>
> It would be better to merge all the vme_user.c printk fixes into
> one patch.
> [patch 1/3] Staging: vme: Fix a white space issue
> [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
> [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>
> It's not a huge deal, it just seems like there was some confusion on
> how to break patches up.


Thanks for your reply!
I will try to fix it.



-- 

Regards,


 .
  .
...

Yamane Toshiaki

yamanetoshi@gmail.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] staging/vme: fix checkpatch warning
  2012-08-17  8:27       ` Toshiaki Yamane
@ 2012-08-17 13:19         ` Greg Kroah-Hartman
  2012-08-17 14:30           ` Toshiaki Yamane
  0 siblings, 1 reply; 22+ messages in thread
From: Greg Kroah-Hartman @ 2012-08-17 13:19 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel

On Fri, Aug 17, 2012 at 05:27:53PM +0900, Toshiaki Yamane wrote:
> On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > You've got the same subject repeated 5 times.
> >
> > It would be better to merge all the vme_user.c printk fixes into
> > one patch.
> > [patch 1/3] Staging: vme: Fix a white space issue
> > [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
> > [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
> >
> > It's not a huge deal, it just seems like there was some confusion on
> > how to break patches up.
> 
> 
> Thanks for your reply!
> I will try to fix it.

Please do, I can't take it as-is.

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] staging/vme: fix checkpatch warning
  2012-08-17 13:19         ` Greg Kroah-Hartman
@ 2012-08-17 14:30           ` Toshiaki Yamane
  2012-08-21 11:11             ` Toshiaki Yamane
  0 siblings, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-17 14:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel

On Fri, Aug 17, 2012 at 10:19 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Fri, Aug 17, 2012 at 05:27:53PM +0900, Toshiaki Yamane wrote:
>> On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> > You've got the same subject repeated 5 times.
>> >
>> > It would be better to merge all the vme_user.c printk fixes into
>> > one patch.
>> > [patch 1/3] Staging: vme: Fix a white space issue
>> > [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
>> > [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>> >
>> > It's not a huge deal, it just seems like there was some confusion on
>> > how to break patches up.
>>
>>
>> Thanks for your reply!
>> I will try to fix it.
>
> Please do, I can't take it as-is.

I will stop, if you say so.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/5] staging/vme: fix checkpatch warning
  2012-08-17 14:30           ` Toshiaki Yamane
@ 2012-08-21 11:11             ` Toshiaki Yamane
  0 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-21 11:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel

On Fri, Aug 17, 2012 at 11:30 PM, Toshiaki Yamane <yamanetoshi@gmail.com> wrote:
> On Fri, Aug 17, 2012 at 10:19 PM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>> On Fri, Aug 17, 2012 at 05:27:53PM +0900, Toshiaki Yamane wrote:
>>> On Fri, Aug 17, 2012 at 4:46 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>>> > You've got the same subject repeated 5 times.
>>> >
>>> > It would be better to merge all the vme_user.c printk fixes into
>>> > one patch.
>>> > [patch 1/3] Staging: vme: Fix a white space issue
>>> > [patch 2/3] Staging: vme: Use pr_ printks in vme_user.c
>>> > [patch 3/3] Staging: vme: Use pr_ printks in vme_pio2_core.c
>>> >
>>> > It's not a huge deal, it just seems like there was some confusion on
>>> > how to break patches up.
>>>
>>>
>>> Thanks for your reply!
>>> I will try to fix it.
>>
>> Please do, I can't take it as-is.
>
> I will stop, if you say so.

Greg-san,

I have misunderstood your reply. I am sorry...
I will send a patch from now.

-- 

Regards,


 .
  .
...

Yamane Toshiaki

yamanetoshi@gmail.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/3] Staging: vme: Fix a white space issue
  2012-08-17  7:46     ` Dan Carpenter
  2012-08-17  8:27       ` Toshiaki Yamane
@ 2012-08-21 11:12       ` Toshiaki Yamane
  2012-08-21 11:12       ` [PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c Toshiaki Yamane
  2012-08-21 11:13       ` [PATCH 3/3] staging/vme: Use pr_ printks in vme_pio2_core.c Toshiaki Yamane
  3 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-21 11:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel,
	Toshiaki Yamane

The below checkpatch error was fixed.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/vme/devices/vme_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e25645e..e39d273 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -396,7 +396,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
 	default:
 		retval = -EINVAL;
 	}
-	
+
 	mutex_unlock(&image[minor].mutex);
 
 	if (retval > 0)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c
  2012-08-17  7:46     ` Dan Carpenter
  2012-08-17  8:27       ` Toshiaki Yamane
  2012-08-21 11:12       ` [PATCH 1/3] Staging: vme: Fix a white space issue Toshiaki Yamane
@ 2012-08-21 11:12       ` Toshiaki Yamane
  2012-09-04 20:20         ` Greg Kroah-Hartman
  2012-08-21 11:13       ` [PATCH 3/3] staging/vme: Use pr_ printks in vme_pio2_core.c Toshiaki Yamane
  3 siblings, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-21 11:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel,
	Toshiaki Yamane

The below checkpatch warnings was fixed,

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

and added pr_fmt.

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e39d273..7d28086 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -170,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");
+		pr_err("No resources allocated for device\n");
 		err = -EINVAL;
 		goto err_res;
 	}
@@ -225,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");
+			pr_info("User copy failed\n");
 			return -EINVAL;
 		}
 
 	} else {
 		/* XXX Need to write this */
-		printk(KERN_INFO "Currently don't support large transfers\n");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_read to do the transfer */
@@ -265,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");
+		pr_info("Currently don't support large transfers\n");
 		/* Map in pages from userspace */
 
 		/* Call vme_master_write to do the transfer */
@@ -286,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -305,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");
+		pr_warn("Partial copy to userspace\n");
 	} else
 		retval = count;
 
@@ -476,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -503,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -515,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -546,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");
+				pr_warn("Partial copy to userspace\n");
 				return -EFAULT;
 			}
 
@@ -558,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");
+				pr_warn("Partial copy from userspace\n");
 				return -EFAULT;
 			}
 
@@ -599,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);
+		pr_debug("UniverseII:Releasing buffer at %p\n",
+			 image[num].pci_buf);
 #endif
 
 		vme_free_consistent(image[num].resource, image[num].size_buf,
@@ -612,7 +610,7 @@ static void buf_unalloc(int num)
 
 #ifdef VME_DEBUG
 	} else {
-		printk(KERN_DEBUG "UniverseII: Buffer not allocated\n");
+		pr_debug("UniverseII: Buffer not allocated\n");
 #endif
 	}
 }
@@ -629,11 +627,10 @@ static int __init vme_user_init(void)
 {
 	int retval = 0;
 
-	printk(KERN_INFO "VME User Space Access Driver\n");
+	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		retval = -ENODEV;
 		goto err_nocard;
 	}
@@ -642,8 +639,8 @@ static int __init vme_user_init(void)
 	 * in future revisions if that ever becomes necessary.
 	 */
 	if (bus_num > VME_USER_BUS_MAX) {
-		printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-			driver_name, VME_USER_BUS_MAX);
+		pr_err("Driver only able to handle %d buses\n",
+		       VME_USER_BUS_MAX);
 		bus_num = VME_USER_BUS_MAX;
 	}
 
@@ -683,8 +680,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
 	/* Save pointer to the bridge device */
 	if (vme_user_bridge != NULL) {
-		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-			driver_name);
+		pr_err("Driver can only be loaded for 1 device\n");
 		err = -EINVAL;
 		goto err_dev;
 	}
@@ -707,8 +703,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
 		driver_name);
 	if (err) {
-		printk(KERN_WARNING "%s: Error getting Major Number %d for "
-		"driver.\n", driver_name, VME_MAJOR);
+		pr_warn("Error getting Major Number %d for driver.\n",
+			VME_MAJOR);
 		goto err_region;
 	}
 
@@ -718,7 +714,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	vme_user_cdev->owner = THIS_MODULE;
 	err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
 	if (err) {
-		printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+		pr_warn("cdev_all failed\n");
 		goto err_char;
 	}
 
@@ -732,16 +728,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate slave "
-				"resource\n");
+			pr_warn("Unable to allocate slave resource\n");
 			goto err_slave;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"buffer\n");
+			pr_warn("Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
 			vme_slave_free(image[i].resource);
 			err = -ENOMEM;
@@ -758,15 +752,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate master "
-				"resource\n");
+			pr_warn("Unable to allocate master resource\n");
 			goto err_master;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"master window buffers\n");
+			pr_warn("Unable to allocate memory for master window buffers\n");
 			err = -ENOMEM;
 			goto err_master_buf;
 		}
@@ -775,7 +767,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	/* Create sysfs entries - on udev systems this creates the dev files */
 	vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
 	if (IS_ERR(vme_user_sysfs_class)) {
-		printk(KERN_ERR "Error creating vme_user class.\n");
+		pr_err("Error creating vme_user class.\n");
 		err = PTR_ERR(vme_user_sysfs_class);
 		goto err_class;
 	}
@@ -803,8 +795,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].device = device_create(vme_user_sysfs_class, NULL,
 					MKDEV(VME_MAJOR, i), NULL, name, num);
 		if (IS_ERR(image[i].device)) {
-			printk(KERN_INFO "%s: Error creating sysfs device\n",
-				driver_name);
+			pr_info("Error creating sysfs device\n");
 			err = PTR_ERR(image[i].device);
 			goto err_sysfs;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/3] staging/vme: Use pr_ printks in vme_pio2_core.c
  2012-08-17  7:46     ` Dan Carpenter
                         ` (2 preceding siblings ...)
  2012-08-21 11:12       ` [PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c Toshiaki Yamane
@ 2012-08-21 11:13       ` Toshiaki Yamane
  3 siblings, 0 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-08-21 11:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Carpenter, Martyn Welch, Manohar Vanga, devel, linux-kernel,
	Toshiaki Yamane

The below checkpatch warnings was fixed,

-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

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

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c b/drivers/staging/vme/devices/vme_pio2_core.c
index 4bf8e05..dad8281 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -10,6 +10,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -163,15 +165,13 @@ static int __init pio2_init(void)
 	int retval = 0;
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		goto err_nocard;
 	}
 
 	if (bus_num > PIO2_CARDS_MAX) {
-		printk(KERN_ERR
-			"%s: Driver only able to handle %d PIO2 Cards\n",
-			driver_name, PIO2_CARDS_MAX);
+		pr_err("Driver only able to handle %d PIO2 Cards\n",
+		       PIO2_CARDS_MAX);
 		bus_num = PIO2_CARDS_MAX;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/3] staging/vme: Use pr_ printks in vme_user.c
  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
  0 siblings, 1 reply; 22+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-04 20:20 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter

On Tue, Aug 21, 2012 at 08:12:53PM +0900, Toshiaki Yamane wrote:
> The below checkpatch warnings was fixed,
> 
> -WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
> -WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
> -WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
> -WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
> 
> and added pr_fmt.

A lot of these can be converted to use dev_info(), dev_debug(),
dev_warn(), and dev_err() instead.  Please do that whenever you have
access to a struct device.

So, sorry, I can't take this patch.

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c
  2012-09-04 20:20         ` Greg Kroah-Hartman
@ 2012-09-11  7:16           ` Toshiaki Yamane
  2012-09-11  7:17             ` [PATCH 2/2] staging/vme: Use dev_ " Toshiaki Yamane
  2012-09-11 19:08             ` [PATCH 1/2] staging/vme: Use pr_ " Greg Kroah-Hartman
  0 siblings, 2 replies; 22+ messages in thread
From: Toshiaki Yamane @ 2012-09-11  7:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter,
	Toshiaki Yamane

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_err(... to printk(KERN_ERR, ...

and added pr_fmt.

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 0170788..1e3311d 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -629,11 +631,10 @@ static int __init vme_user_init(void)
 {
 	int retval = 0;
 
-	printk(KERN_INFO "VME User Space Access Driver\n");
+	pr_info("VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
-		printk(KERN_ERR "%s: No cards, skipping registration\n",
-			driver_name);
+		pr_err("No cards, skipping registration\n");
 		retval = -ENODEV;
 		goto err_nocard;
 	}
@@ -642,8 +643,8 @@ static int __init vme_user_init(void)
 	 * in future revisions if that ever becomes necessary.
 	 */
 	if (bus_num > VME_USER_BUS_MAX) {
-		printk(KERN_ERR "%s: Driver only able to handle %d buses\n",
-			driver_name, VME_USER_BUS_MAX);
+		pr_err("Driver only able to handle %d buses\n",
+		       VME_USER_BUS_MAX);
 		bus_num = VME_USER_BUS_MAX;
 	}
 
@@ -683,8 +684,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 
 	/* Save pointer to the bridge device */
 	if (vme_user_bridge != NULL) {
-		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
-			driver_name);
+		pr_err("Driver can only be loaded for 1 device\n");
 		err = -EINVAL;
 		goto err_dev;
 	}
@@ -707,8 +707,8 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	err = register_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS,
 		driver_name);
 	if (err) {
-		printk(KERN_WARNING "%s: Error getting Major Number %d for "
-		"driver.\n", driver_name, VME_MAJOR);
+		pr_warn("Error getting Major Number %d for driver.\n",
+			VME_MAJOR);
 		goto err_region;
 	}
 
@@ -718,7 +718,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	vme_user_cdev->owner = THIS_MODULE;
 	err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
 	if (err) {
-		printk(KERN_WARNING "%s: cdev_all failed\n", driver_name);
+		pr_warn("cdev_all failed\n");
 		goto err_char;
 	}
 
@@ -732,16 +732,14 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate slave "
-				"resource\n");
+			pr_warn("Unable to allocate slave resource\n");
 			goto err_slave;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"buffer\n");
+			pr_warn("Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
 			vme_slave_free(image[i].resource);
 			err = -ENOMEM;
@@ -758,15 +756,13 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
-			printk(KERN_WARNING "Unable to allocate master "
-				"resource\n");
+			pr_warn("Unable to allocate master resource\n");
 			goto err_master;
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
 		if (image[i].kern_buf == NULL) {
-			printk(KERN_WARNING "Unable to allocate memory for "
-				"master window buffers\n");
+			pr_warn("Unable to allocate memory for master window buffers\n");
 			err = -ENOMEM;
 			goto err_master_buf;
 		}
@@ -775,7 +771,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 	/* Create sysfs entries - on udev systems this creates the dev files */
 	vme_user_sysfs_class = class_create(THIS_MODULE, driver_name);
 	if (IS_ERR(vme_user_sysfs_class)) {
-		printk(KERN_ERR "Error creating vme_user class.\n");
+		pr_err("Error creating vme_user class.\n");
 		err = PTR_ERR(vme_user_sysfs_class);
 		goto err_class;
 	}
@@ -803,8 +799,7 @@ static int __devinit vme_user_probe(struct vme_dev *vdev)
 		image[i].device = device_create(vme_user_sysfs_class, NULL,
 					MKDEV(VME_MAJOR, i), NULL, name, num);
 		if (IS_ERR(image[i].device)) {
-			printk(KERN_INFO "%s: Error creating sysfs device\n",
-				driver_name);
+			pr_info("Error creating sysfs device\n");
 			err = PTR_ERR(image[i].device);
 			goto err_sysfs;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/2] staging/vme: Use dev_ printks in vme_user.c
  2012-09-11  7:16           ` [PATCH 1/2] " Toshiaki Yamane
@ 2012-09-11  7:17             ` Toshiaki Yamane
  2012-09-11 19:08               ` Greg Kroah-Hartman
  2012-09-11 19:08             ` [PATCH 1/2] staging/vme: Use pr_ " Greg Kroah-Hartman
  1 sibling, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-09-11  7:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter,
	Toshiaki Yamane

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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c
  2012-09-11  7:16           ` [PATCH 1/2] " Toshiaki Yamane
  2012-09-11  7:17             ` [PATCH 2/2] staging/vme: Use dev_ " Toshiaki Yamane
@ 2012-09-11 19:08             ` Greg Kroah-Hartman
  2012-09-12  7:36               ` Toshiaki Yamane
  1 sibling, 1 reply; 22+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-11 19:08 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter

On Tue, Sep 11, 2012 at 04:16:14PM +0900, Toshiaki Yamane wrote:
> 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_err(... to printk(KERN_ERR, ...

A lot of these can be using dev_* instead of the pr_* functions, right?
Please convert to using them wherever possible.

Because of that, I can't take this patch, sorry.  Care to redo it?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/2] staging/vme: Use dev_ printks in vme_user.c
  2012-09-11  7:17             ` [PATCH 2/2] staging/vme: Use dev_ " Toshiaki Yamane
@ 2012-09-11 19:08               ` Greg Kroah-Hartman
  0 siblings, 0 replies; 22+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-11 19:08 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter

On Tue, Sep 11, 2012 at 04:17:03PM +0900, Toshiaki Yamane wrote:
> 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>

Same comment at 1/2 applies here as well.

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c
  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
  0 siblings, 1 reply; 22+ messages in thread
From: Toshiaki Yamane @ 2012-09-12  7:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, Manohar Vanga, linux-kernel, Martyn Welch, Dan Carpenter

On Wed, Sep 12, 2012 at 4:08 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Tue, Sep 11, 2012 at 04:16:14PM +0900, Toshiaki Yamane wrote:
>> 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_err(... to printk(KERN_ERR, ...
>
> A lot of these can be using dev_* instead of the pr_* functions, right?
> Please convert to using them wherever possible.
>
> Because of that, I can't take this patch, sorry.  Care to redo it?

Yes. Is this collect?

I must use dev_* procedure when the following conditions are met:
- If I have access to struct device object by the argument of the procedure
- Except for the right: struct net_device, etc.

Otherwise, I must use pr_* procedure.


Regards,

YAMANE Toshiaki

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/2] staging/vme: Use pr_ printks in vme_user.c
  2012-09-12  7:36               ` Toshiaki Yamane
@ 2012-09-12 14:04                 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 22+ messages in thread
From: Greg Kroah-Hartman @ 2012-09-12 14:04 UTC (permalink / raw)
  To: Toshiaki Yamane
  Cc: devel, Martyn Welch, Manohar Vanga, Dan Carpenter, linux-kernel

On Wed, Sep 12, 2012 at 04:36:19PM +0900, Toshiaki Yamane wrote:
> On Wed, Sep 12, 2012 at 4:08 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Tue, Sep 11, 2012 at 04:16:14PM +0900, Toshiaki Yamane wrote:
> >> 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_err(... to printk(KERN_ERR, ...
> >
> > A lot of these can be using dev_* instead of the pr_* functions, right?
> > Please convert to using them wherever possible.
> >
> > Because of that, I can't take this patch, sorry.  Care to redo it?
> 
> Yes. Is this collect?

"correct"?

> I must use dev_* procedure when the following conditions are met:
> - If I have access to struct device object by the argument of the procedure
> - Except for the right: struct net_device, etc.
> 
> Otherwise, I must use pr_* procedure.

Yes, that is correct :)

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-09-12 14:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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             ` [PATCH 2/2] staging/vme: Use dev_ " Toshiaki Yamane
2012-09-11 19:08               ` 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

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).