Re: [PATCH 10/11 v2] staging: dgap: Fix printk related errors as reported by checkpatch

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

 



On 03/03/2014 10:11 AM, Mark Hounschell wrote:
This patch fixes some printk related errors report by checkpatch.

Signed-off-by: Mark Hounschell <markh@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/dgap/dgap.c | 13 ++-----------
  1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index cac2791..fe2e7ea 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -540,7 +540,7 @@ static int dgap_init_module(void)
  		if (dgap_NumBoards)
  			pci_unregister_driver(&dgap_driver);
  		else
-			printk("WARNING: dgap driver load failed.  No DGAP boards found.\n");
+			pr_err("dgap: driver load failed. No boards found.\n");

  		dgap_cleanup_module();
  	} else {
@@ -2948,7 +2948,6 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int

  		if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) {
  			up(&dgap_TmpWriteSem);
-			printk("Write: Copy from user failed!\n");
  			return -EFAULT;
  		}

@@ -6082,7 +6081,6 @@ static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dga

  static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
  {
-	int rc = 0;
  	struct device_driver *driverfs = &dgap_driver->driver;

  	rc |= driver_create_file(driverfs, &driver_attr_version);
@@ -6092,8 +6090,6 @@ static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
  	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
  	rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
  	rc |= driver_create_file(driverfs, &driver_attr_state);
-	if (rc)
-		printk(KERN_ERR "DGAP: sysfs driver_create_file failed!\n");
  }

  static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
@@ -6287,8 +6283,6 @@ static DEVICE_ATTR(ports_txcount, S_IRUSR, dgap_ports_txcount_show, NULL);
   */
  static void dgap_create_ports_sysfiles(struct board_t *bd)
  {
-	int rc = 0;
-
  	dev_set_drvdata(&bd->pdev->dev, bd);
  	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state);
  	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud);
@@ -6300,8 +6294,6 @@ static void dgap_create_ports_sysfiles(struct board_t *bd)
  	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
  	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
  	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
-	if (rc)
-		printk(KERN_ERR "DGAP: sysfs device_create_file failed!\n");
  }

  /* removes all the sys files created for that port */
@@ -6689,7 +6681,6 @@ static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)

  	ret = sysfs_create_group(&c->kobj, &dgap_tty_attribute_group);
  	if (ret) {
-		printk(KERN_ERR "dgap: failed to create sysfs tty device attributes.\n");
  		sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
  		return;
  	}
@@ -7563,7 +7554,7 @@ static char *dgap_getword(char **in)
   */
  static void dgap_err(char *s)
  {
-	printk("DGAP: parse: %s\n", s);
+	pr_err("dgap: parse: %s\n", s);
  }

  /*


Ignore this please. It won't even compile. Sorry

Mark
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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