[PATCH 2/2] Staging: dt3155: fix coding style issues indt3155_drv.c
From: Joe Eloff
Date: Mon Jul 05 2010 - 18:02:52 EST
>From eba804d73097793329e857bebb31bd1de39cad5c Mon Sep 17 00:00:00 2001
From: Joe Eloff <kagen101@xxxxxxxxx>
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.
Signed-off-by: Joe Eloff <kagen101@xxxxxxxxx>
---
drivers/staging/dt3155/dt3155_drv.c | 33
++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/dt3155/dt3155_drv.c
b/drivers/staging/dt3155/dt3155_drv.c
index 75a2244..66db878 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -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;
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/