lkml.org 
[lkml]   [2000]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 2.3.99-pre3-6: xd.c __setup functions
Here's a patch to clean up the __setup functions in xd.c.  I haven't
tested it.

Tim.
*/

Index: drivers/block/xd.c
===================================================================
RCS file: /usr/local/src/cvsroot/linux/drivers/block/xd.c,v
retrieving revision 1.1.1.10
diff -d -u -r1.1.1.10 xd.c
--- drivers/block/xd.c 2000/02/17 10:04:38 1.1.1.10
+++ drivers/block/xd.c 2000/03/22 15:25:22
@@ -1059,7 +1059,7 @@
}

/* xd_setup: initialise controler from command line parameters */
-void __init xd_setup (char *command,int *integers)
+void __init do_xd_setup (int *integers)
{
switch (integers[0]) {
case 4: if (integers[4] < 0)
@@ -1079,21 +1079,6 @@
xd_maxsectors = 0x01;
}

-#ifndef MODULE
-/* xd_manual_geo_init: initialise drive geometry from command line parameters
- (used only for WD drives) */
-void __init xd_manual_geo_init (char *command,int *integers)
-{
- int i;
- if (integers[0]%3 != 0) {
- printk("xd: incorrect number of parameters for xd_geo\n");
- return;
- }
- for (i = 0; (i < integers[0]) && (i < 3*XD_MAXDRIVES); i++)
- xd_geo[i] = integers[i+1];
-}
-#endif /* MODULE */
-
/* xd_setparam: set the drive characteristics */
static void __init xd_setparam (u_char command,u_char drive,u_char heads,u_short cylinders,u_short rwrite,u_short wprecomp,u_char ecc)
{
@@ -1149,7 +1134,7 @@
if(((xd[i] = xd[i-1]) >= 0) && !count)
count = i;
if((xd[0] = count))
- xd_setup(NULL, xd);
+ do_xd_setup(xd);

if (error = xd_init())
return error;
@@ -1190,6 +1175,30 @@
}
}
#else
+
+static int __init xd_setup (char *str)
+{
+ int ints[5];
+ get_options (str, ARRAY_SIZE (ints), ints);
+ do_xd_setup (ints);
+ return 1;
+}
+
+/* xd_manual_geo_init: initialise drive geometry from command line parameters
+ (used only for WD drives) */
+static int __init xd_manual_geo_init (char *str)
+{
+ int i, integers[1 + 3*XD_MAXDRIVES];
+
+ get_options (str, ARRAY_SIZE (ints), ints);
+ if (integers[0]%3 != 0) {
+ printk("xd: incorrect number of parameters for xd_geo\n");
+ return 1;
+ }
+ for (i = 0; (i < integers[0]) && (i < 3*XD_MAXDRIVES); i++)
+ xd_geo[i] = integers[i+1];
+ return 1;
+}

__setup ("xd=", xd_setup);
__setup ("xd_geo=", xd_manual_geo_init);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.033 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site