* [2.6 patch] drivers/char/specialix.c: misc cleanups
@ 2004-12-05 17:16 Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2004-12-05 17:16 UTC (permalink / raw)
To: R.E.Wolff; +Cc: io8-linux, linux-kernel
The patch below includes cleanups including the following:
- remove the unused global function specialix_setup
- merge specialix_init_module into specialix_init
- rename specialix_exit_module to specialix_exit
- make some needlessly global code static
diffstat output:
drivers/char/specialix.c | 91 +++++++++++----------------------------
1 files changed, 27 insertions(+), 64 deletions(-)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.10-rc1-mm3-full/drivers/char/specialix.c.old 2004-11-07 00:55:20.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/char/specialix.c 2004-11-07 01:37:43.000000000 +0100
@@ -315,7 +315,7 @@
/* Set the IRQ using the RTS lines that run to the PAL on the board.... */
-int sx_set_irq ( struct specialix_board *bp)
+static int sx_set_irq ( struct specialix_board *bp)
{
int virq;
int i;
@@ -379,7 +379,7 @@
}
-int read_cross_byte (struct specialix_board *bp, int reg, int bit)
+static int read_cross_byte (struct specialix_board *bp, int reg, int bit)
{
int i;
int t;
@@ -878,7 +878,7 @@
* Routines for open & close processing.
*/
-void turn_ints_off (struct specialix_board *bp)
+static void turn_ints_off (struct specialix_board *bp)
{
if (bp->flags & SX_BOARD_IS_PCI) {
/* This was intended for enabeling the interrupt on the
@@ -889,7 +889,7 @@
(void) sx_in_off (bp, 0); /* Turn off interrupts. */
}
-void turn_ints_on (struct specialix_board *bp)
+static void turn_ints_on (struct specialix_board *bp)
{
if (bp->flags & SX_BOARD_IS_PCI) {
/* play with the PCI chip. See comment above. */
@@ -2094,41 +2094,34 @@
}
-#ifndef MODULE
+static int iobase[SX_NBOARD] = {0,};
+
+static int irq [SX_NBOARD] = {0,};
+
+module_param_array(iobase, int, NULL, 0);
+module_param_array(irq, int, NULL, 0);
+
/*
- * Called at boot time.
+ * You can setup up to 4 boards.
+ * by specifying "iobase=0xXXX,0xXXX ..." as insmod parameter.
+ * You should specify the IRQs too in that case "irq=....,...".
*
- * You can specify IO base for up to SX_NBOARD cards,
- * using line "specialix=0xiobase1,0xiobase2,.." at LILO prompt.
- * Note that there will be no probing at default
- * addresses in this case.
+ * More than 4 boards in one computer is not possible, as the card can
+ * only use 4 different interrupts.
*
- */
-void specialix_setup(char *str, int * ints)
-{
- int i;
-
- for (i=0;i<SX_NBOARD;i++) {
- sx_board[i].base = 0;
- }
-
- for (i = 1; i <= ints[0]; i++) {
- if (i&1)
- sx_board[i/2].base = ints[i];
- else
- sx_board[i/2 -1].irq = ints[i];
- }
-}
-#endif
-
-/*
- * This routine must be called by kernel at boot time
*/
static int __init specialix_init(void)
{
int i;
int found = 0;
+ if (iobase[0] || iobase[1] || iobase[2] || iobase[3]) {
+ for(i = 0; i < SX_NBOARD; i++) {
+ sx_board[i].base = iobase[i];
+ sx_board[i].irq = irq[i];
+ }
+ }
+
printk(KERN_INFO "sx: Specialix IO8+ driver v" VERSION ", (c) R.E.Wolff 1997/1998.\n");
printk(KERN_INFO "sx: derived from work (c) D.Gorodchanin 1994-1996.\n");
#ifdef CONFIG_SPECIALIX_RTSCTS
@@ -2148,7 +2141,7 @@
{
struct pci_dev *pdev = NULL;
- i=0;
+ i = 0;
while (i < SX_NBOARD) {
if (sx_board[i].flags & SX_BOARD_PRESENT) {
i++;
@@ -2181,38 +2174,8 @@
return 0;
}
-
-int iobase[SX_NBOARD] = {0,};
-
-int irq [SX_NBOARD] = {0,};
-
-module_param_array(iobase, int, NULL, 0);
-module_param_array(irq, int, NULL, 0);
-
-/*
- * You can setup up to 4 boards.
- * by specifying "iobase=0xXXX,0xXXX ..." as insmod parameter.
- * You should specify the IRQs too in that case "irq=....,...".
- *
- * More than 4 boards in one computer is not possible, as the card can
- * only use 4 different interrupts.
- *
- */
-static int __init specialix_init_module(void)
-{
- int i;
-
- if (iobase[0] || iobase[1] || iobase[2] || iobase[3]) {
- for(i = 0; i < SX_NBOARD; i++) {
- sx_board[i].base = iobase[i];
- sx_board[i].irq = irq[i];
- }
- }
-
- return specialix_init();
-}
-static void __exit specialix_exit_module(void)
+static void __exit specialix_exit(void)
{
int i;
@@ -2226,7 +2189,7 @@
}
-module_init(specialix_init_module);
-module_exit(specialix_exit_module);
+module_init(specialix_init);
+module_exit(specialix_exit);
MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 3+ messages in thread* [2.6 patch] drivers/char/specialix.c: misc cleanups
@ 2005-01-31 17:36 Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-01-31 17:36 UTC (permalink / raw)
To: R.E.Wolff; +Cc: linux-kernel
This patch contains the following cleanups:
- make some needlessly global code static
- remove the unused global function specialix_setup
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/char/specialix.c | 43 +++++----------------------------------
1 files changed, 6 insertions(+), 37 deletions(-)
--- linux-2.6.11-rc2-mm2-full/drivers/char/specialix.c.old 2005-01-31 15:06:25.000000000 +0100
+++ linux-2.6.11-rc2-mm2-full/drivers/char/specialix.c 2005-01-31 15:07:39.000000000 +0100
@@ -372,7 +372,7 @@
/* Set the IRQ using the RTS lines that run to the PAL on the board.... */
-int sx_set_irq ( struct specialix_board *bp)
+static int sx_set_irq ( struct specialix_board *bp)
{
int virq;
int i;
@@ -439,7 +439,7 @@
}
-int read_cross_byte (struct specialix_board *bp, int reg, int bit)
+static int read_cross_byte (struct specialix_board *bp, int reg, int bit)
{
int i;
int t;
@@ -985,7 +985,7 @@
* Routines for open & close processing.
*/
-void turn_ints_off (struct specialix_board *bp)
+static void turn_ints_off (struct specialix_board *bp)
{
unsigned long flags;
func_enter ();
@@ -1004,7 +1004,7 @@
func_exit ();
}
-void turn_ints_on (struct specialix_board *bp)
+static void turn_ints_on (struct specialix_board *bp)
{
unsigned long flags;
@@ -2478,37 +2478,6 @@
}
-#ifndef MODULE
-/*
- * Called at boot time.
- *
- * You can specify IO base for up to SX_NBOARD cards,
- * using line "specialix=0xiobase1,0xiobase2,.." at LILO prompt.
- * Note that there will be no probing at default
- * addresses in this case.
- *
- */
-void specialix_setup(char *str, int * ints)
-{
- int i;
-
- func_enter ();
-
- for (i=0;i<SX_NBOARD;i++) {
- sx_board[i].base = 0;
- }
-
- for (i = 1; i <= ints[0]; i++) {
- if (i&1)
- sx_board[i/2].base = ints[i];
- else
- sx_board[i/2 -1].irq = ints[i];
- }
-
- func_exit ();
-}
-#endif
-
/*
* This routine must be called by kernel at boot time
*/
@@ -2579,9 +2548,9 @@
return 0;
}
-int iobase[SX_NBOARD] = {0,};
+static int iobase[SX_NBOARD] = {0,};
-int irq [SX_NBOARD] = {0,};
+static int irq [SX_NBOARD] = {0,};
module_param_array(iobase, int, NULL, 0);
module_param_array(irq, int, NULL, 0);
^ permalink raw reply [flat|nested] 3+ messages in thread* [2.6 patch] drivers/char/specialix.c: misc cleanups
@ 2005-02-24 23:39 Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-02-24 23:39 UTC (permalink / raw)
To: Andrew Morton; +Cc: R.E.Wolff, linux-kernel
This patch contains the following cleanups:
- make some needlessly global code static
- remove the unused global function specialix_setup
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 31 Jan 2005
drivers/char/specialix.c | 43 +++++----------------------------------
1 files changed, 6 insertions(+), 37 deletions(-)
--- linux-2.6.11-rc2-mm2-full/drivers/char/specialix.c.old 2005-01-31 15:06:25.000000000 +0100
+++ linux-2.6.11-rc2-mm2-full/drivers/char/specialix.c 2005-01-31 15:07:39.000000000 +0100
@@ -372,7 +372,7 @@
/* Set the IRQ using the RTS lines that run to the PAL on the board.... */
-int sx_set_irq ( struct specialix_board *bp)
+static int sx_set_irq ( struct specialix_board *bp)
{
int virq;
int i;
@@ -439,7 +439,7 @@
}
-int read_cross_byte (struct specialix_board *bp, int reg, int bit)
+static int read_cross_byte (struct specialix_board *bp, int reg, int bit)
{
int i;
int t;
@@ -985,7 +985,7 @@
* Routines for open & close processing.
*/
-void turn_ints_off (struct specialix_board *bp)
+static void turn_ints_off (struct specialix_board *bp)
{
unsigned long flags;
func_enter ();
@@ -1004,7 +1004,7 @@
func_exit ();
}
-void turn_ints_on (struct specialix_board *bp)
+static void turn_ints_on (struct specialix_board *bp)
{
unsigned long flags;
@@ -2478,37 +2478,6 @@
}
-#ifndef MODULE
-/*
- * Called at boot time.
- *
- * You can specify IO base for up to SX_NBOARD cards,
- * using line "specialix=0xiobase1,0xiobase2,.." at LILO prompt.
- * Note that there will be no probing at default
- * addresses in this case.
- *
- */
-void specialix_setup(char *str, int * ints)
-{
- int i;
-
- func_enter ();
-
- for (i=0;i<SX_NBOARD;i++) {
- sx_board[i].base = 0;
- }
-
- for (i = 1; i <= ints[0]; i++) {
- if (i&1)
- sx_board[i/2].base = ints[i];
- else
- sx_board[i/2 -1].irq = ints[i];
- }
-
- func_exit ();
-}
-#endif
-
/*
* This routine must be called by kernel at boot time
*/
@@ -2579,9 +2548,9 @@
return 0;
}
-int iobase[SX_NBOARD] = {0,};
+static int iobase[SX_NBOARD] = {0,};
-int irq [SX_NBOARD] = {0,};
+static int irq [SX_NBOARD] = {0,};
module_param_array(iobase, int, NULL, 0);
module_param_array(irq, int, NULL, 0);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-25 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-05 17:16 [2.6 patch] drivers/char/specialix.c: misc cleanups Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2005-01-31 17:36 Adrian Bunk
2005-02-24 23:39 Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox