Skip to contentSkip to conversation

Staging: dt3155: fix coding style issues in dt3155_drv.c

PATCH In review Joe Eloff 4 participants 4 messages Jul 5, 2010 – Jul 8, 2010 Staging

lore
Share & tools
lore

Joe Eloff

author
#0 lore raw

PATCH 2/2 Staging: dt3155: fix coding style issues in dt3155_drv.c

Quoted 1 line

From eba804d73097793329e857bebb31bd1de39cad5c Mon Sep 17 00:00:00 2001

From: Joe Eloff <[email protected]>
Date: Mon, 5 Jul 2010 23:53:36 +0200
Subject: [PATCH 2/2] Staging: dt3155: fix coding style issues in dt3155_drv.c

This is a patch to the dt3155_drv.c file that fixes up last errors found by the checkpatch.pl tool.

---
 drivers/staging/dt3155/dt3155_drv.c |   33
++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/dt3155/dt3155_drv.c
index 75a2244..66db878 100644

drivers/staging/dt3155/dt3155_drv.c +16 -14
@@ -78,7 +78,7 @@ extern void printques(int);
 MODULE_LICENSE("GPL");
 
 /* Error variable.  Zero means no error. */
-int dt3155_errno = 0;
+int dt3155_errno ;
 
 #ifndef PCI_DEVICE_ID_INTEL_7116
 #define PCI_DEVICE_ID_INTEL_7116 0x1223
@@ -99,7 +99,7 @@ wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
 
 /* set to dynamicaly allocate, but it is tunable: */
 /* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
+int dt3155_major;
 
 /* The minor numbers are 0 and 1 ... they are not tunable.
  * They are used as the indices for the structure vectors,
@@ -124,8 +124,8 @@ u32  dt3155_dev_open[MAXBOARDS] = {0
 #endif
 };
 
-u32  ndevices = 0;
-u32 unique_tag = 0;;
+u32  ndevices;
+u32 unique_tag;
 
 
 /*
@@ -827,8 +827,9 @@ static int find_PCI(void)
 		dts = &dt3155_status[pci_index++];
 
 		/* Is it really there? */
-		if ((error = pci_read_config_word(pci_dev,
-		    PCI_CLASS_DEVICE, &rev_device)))
+		error = pci_read_config_word(pci_dev,
+		    PCI_CLASS_DEVICE, &rev_device);
+		if (error)
 			continue;
 
 		/* Found a board */
@@ -847,8 +848,9 @@ static int find_PCI(void)
 
 		/* Now, just go out and make sure that this/these device(s)
 		   is/are actually mapped into the kernel address space */
-		if ((error = pci_read_config_dword(pci_dev, PCI_BASE_ADDRESS_0,
-		    (u32 *) &base))) {
+		error = pci_read_config_dword(pci_dev, PCI_BASE_ADDRESS_0,
+		    (u32 *) &base);
+		if (error) {
 			printk(KERN_INFO "DT3155: Was not able to find device\n");
 			goto err;
 		}
@@ -868,9 +870,9 @@ static int find_PCI(void)
 			printk(KERN_INFO "DT3155: Unable to remap control registers\n");
 			goto err;
 		}
-
-		if ((error = pci_read_config_byte(pci_dev,
-		    PCI_INTERRUPT_LINE, &irq))) {
+		error = pci_read_config_byte(pci_dev,
+		    PCI_INTERRUPT_LINE, &irq);
+		if (error) {
 			printk(KERN_INFO "DT3155: Was not able to find device\n");
 			goto err;
 		}
@@ -892,7 +894,7 @@ err:
  return -EIO;
 }
 
-u32 allocatorAddr = 0;
+u32 allocatorAddr;
 
 /*****************************************************
  * init_module()
@@ -942,15 +944,16 @@ int init_module(void)
 	}
 	/* Now let's find the hardware.  find_PCI() will set ndevices to the
 	 * number of cards found in this machine. */
-
-	if ((rcode = find_PCI()) != 0) {
+	rcode = find_PCI();
+	if (rcode != 0) {
 		printk(KERN_ERR "DT3155 error: find_PCI() failed to find dt3155

board(s)\n");
unregister_chrdev(dt3155_major, "dt3155"); return rcode;
}

/* Ok, time to setup the frame buffers */
- if ((rcode = dt3155_setup_buffers(&allocatorAddr)) < 0) {
+ rcode = dt3155_setup_buffers(&allocatorAddr);
+ if (rcode < 0) {
printk(KERN_ERR "DT3155: Error: setting up buffer not large
enough.");
unregister_chrdev(dt3155_major, "dt3155"); return rcode;

Signature · 1 line
1.6.3.3
Reviewed-by on v1 2/2
#1 lore raw
Quoted 9 lines · Joe Eloff
Quoted 1 line

From eba804d73097793329e857bebb31bd1de39cad5c Mon Sep 17 00:00:00 2001

From: Joe Eloff <[email protected]>
Date: Mon, 5 Jul 2010 23:53:36 +0200
Subject: [PATCH 2/2] Staging: dt3155: fix coding style issues in dt3155_drv.c

This is a patch to the dt3155_drv.c file that fixes up last errors found by the checkpatch.pl tool.

This looks entirely reasonable to me.

#2 lore raw
In reply to Joe Eloff

drivers/staging/dt3155/dt3155_drv.c extern void printques(int); · line 81

Quoted 8 lines · Joe Eloff
drivers/staging/dt3155/dt3155_drv.c +1 -1
@@ -78,7 +78,7 @@ extern void printques(int);
 MODULE_LICENSE("GPL");
 
 /* Error variable.  Zero means no error. */
-int dt3155_errno = 0;
+int dt3155_errno ;

Isn't this a checkpatch error :)?

Signature · 1 line
js
#3 lore raw
In reply to Joe Eloff
Quoted 6 lines · Joe Eloff
Quoted 1 line

From eba804d73097793329e857bebb31bd1de39cad5c Mon Sep 17 00:00:00 2001

From: Joe Eloff <[email protected]>
Date: Mon, 5 Jul 2010 23:53:36 +0200
Subject: [PATCH 2/2] Staging: dt3155: fix coding style issues in dt3155_drv.c

Quoted 6 lines

This is a patch to the dt3155_drv.c file that fixes up last errors found by the checkpatch.pl tool.

---
 drivers/staging/dt3155/dt3155_drv.c |   33

++++++++++++++++++---------------

The patch is line-wrapped and can't be applied :(

care to redo it?

greg k-h