Skip to contentSkip to conversation

Staging: comedi: drivers: Code style issues

PATCH In review Chihau Chau 2 participants 2 messages Jul 22, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: drivers: Code style issues

From: Chihau Chau <[email protected]>

This fix some lines over 80 characters.

---
 drivers/staging/comedi/drivers.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers.c +8 -9
index 4a29ed7..50c8295 100644
@@ -117,8 +117,8 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	for (driv = comedi_drivers; driv; driv = driv->next) {
 		if (!try_module_get(driv->module)) {
-			printk
-			    (KERN_INFO "comedi: failed to increment module count, skipping\n");
+			printk(KERN_INFO "comedi: failed to increment module "
+				"count, skipping\n");
 			continue;
 		}
 		if (driv->num_names) {
@@ -205,9 +205,8 @@ int comedi_driver_unregister(struct comedi_driver *driver)
 		mutex_lock(&dev->mutex);
 		if (dev->attached && dev->driver == driver) {
 			if (dev->use_count)
-				printk
-				    (KERN_WARNING "BUG! detaching device with use_count=%d\n",
-				     dev->use_count);
+				printk(KERN_WARNING "BUG! detaching device with"
+					" use_count=%d\n", dev->use_count);
 			comedi_device_detach(dev);
 		}
 		mutex_unlock(&dev->mutex);
@@ -646,8 +645,8 @@ unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
 {
 	if ((int)(async->buf_write_count + nbytes -
 		  async->buf_write_alloc_count) > 0) {
-		printk
-		    (KERN_INFO "comedi: attempted to write-free more bytes than have been write-allocated.\n");
+		printk(KERN_INFO "comedi: attempted to write-free more bytes "
+			"than have been write-allocated.\n");
 		nbytes = async->buf_write_alloc_count - async->buf_write_count;
 	}
 	async->buf_write_count += nbytes;
@@ -683,8 +682,8 @@ unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes)
 	smp_mb();
 	if ((int)(async->buf_read_count + nbytes -
 		  async->buf_read_alloc_count) > 0) {
-		printk(KERN_INFO
-		       "comedi: attempted to read-free more bytes than have been read-allocated.\n");
+		printk(KERN_INFO "comedi: attempted to read-free more bytes "
+			"than have been read-allocated.\n");
 		nbytes = async->buf_read_alloc_count - async->buf_read_count;
 	}
 	async->buf_read_count += nbytes;
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 14 lines · Chihau Chau

From: Chihau Chau <[email protected]>

This fix some lines over 80 characters.

---
 drivers/staging/comedi/drivers.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers.c +0 -0
index 4a29ed7..50c8295 100644

drivers/staging/comedi/drivers.c int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it) · line 121

Quoted 7 lines
drivers/staging/comedi/drivers.c +2 -2
@@ -117,8 +117,8 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	for (driv = comedi_drivers; driv; driv = driv->next) {
 		if (!try_module_get(driv->module)) {
-			printk
-			    (KERN_INFO "comedi: failed to increment module count, skipping\n");
+			printk(KERN_INFO "comedi: failed to increment module "
+				"count, skipping\n");

No, please don't break strings across lines like this, it makes it harder to grep for things.

How about something like:

			printk(KERN_INFO "comedi: failed to increment module count, skipping\n");

instead. That should pass the checkpatch.pl script, right?

thanks,

greg k-h