[PATCH] Staging: i4l: Correct coding style errors

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

 



Some lines with more than 80 characters has been corrected.

Also, some printk() functions has been changed with their proper
print functions suggested by checkpatch.pl script as well as some
open braces has been aligned properly.

Finally, two strings has been merged into unique string.

Signed-off-by: Javier Rodriguez <jrodbar@xxxxxxxx>
---
 drivers/staging/i4l/pcbit/module.c | 40 ++++++++++++++++----------------------
 1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/i4l/pcbit/module.c b/drivers/staging/i4l/pcbit/module.c
index 0a59bd0..c4450fc 100644
--- a/drivers/staging/i4l/pcbit/module.c
+++ b/drivers/staging/i4l/pcbit/module.c
@@ -25,8 +25,8 @@
 static int mem[MAX_PCBIT_CARDS];
 static int irq[MAX_PCBIT_CARDS];
 
-module_param_array(mem, int, NULL, 0);
-module_param_array(irq, int, NULL, 0);
+module_param_array(mem, int, NULL, 0x0);
+module_param_array(irq, int, NULL, 0x0);
 
 static int num_boards;
 struct pcbit_dev *dev_pcbit[MAX_PCBIT_CARDS];
@@ -37,27 +37,25 @@ static int __init pcbit_init(void)
 
 	num_boards = 0;
 
-	printk(KERN_NOTICE
-	       "PCBIT-D device driver v 0.5-fjpc0 19991204 - "
-	       "Copyright (C) 1996 Universidade de Lisboa\n");
+	pr_notice("PCBIT-D device driver v 0.5-fjpc0 19991204 - Copyright (C) 1996 Universidade de Lisboa\n");
 
-	if (mem[0] || irq[0])
-	{
-		for (board = 0; board < MAX_PCBIT_CARDS && mem[board] && irq[board]; board++)
-		{
+	if (mem[0] || irq[0]) {
+		for (board = 0;
+		     board < MAX_PCBIT_CARDS && mem[board] && irq[board];
+		     board++) {
 			if (!mem[board])
 				mem[board] = 0xD0000;
 			if (!irq[board])
 				irq[board] = 5;
 
-			if (pcbit_init_dev(board, mem[board], irq[board]) == 0)
+			if (pcbit_init_dev(board,
+					   mem[board],
+					   irq[board]) == 0) {
 				num_boards++;
 
-			else
-			{
-				printk(KERN_WARNING
-				       "pcbit_init failed for dev %d",
-				       board + 1);
+			} else {
+				pr_warn("pcbit_init failed for dev %d",
+					board + 1);
 				return -EIO;
 			}
 		}
@@ -65,10 +63,8 @@ static int __init pcbit_init(void)
 
 	/* Hardcoded default settings detection */
 
-	if (!num_boards)
-	{
-		printk(KERN_INFO
-		       "Trying to detect board using default settings\n");
+	if (!num_boards) {
+		pr_info("Trying to detect board using default settings\n");
 		if (pcbit_init_dev(0, 0xD0000, 5) == 0)
 			num_boards++;
 		else
@@ -84,8 +80,7 @@ static void __exit pcbit_exit(void)
 
 	for (board = 0; board < num_boards; board++)
 		pcbit_terminate(board);
-	printk(KERN_NOTICE
-	       "PCBIT-D module unloaded\n");
+	pr_notice("PCBIT-D module unloaded\n");
 #endif
 }
 
@@ -103,7 +98,6 @@ static int __init pcbit_setup(char *line)
 	j = 1;
 
 	while (argc && (i < MAX_PCBIT_CARDS)) {
-
 		if (argc) {
 			mem[i]	= ints[j];
 			j++; argc--;
@@ -116,7 +110,7 @@ static int __init pcbit_setup(char *line)
 
 		i++;
 	}
-	return (1);
+	return 1;
 }
 __setup("pcbit=", pcbit_setup);
 #endif
-- 
1.9.1

_______________________________________________
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