xconfig

Andries.Brouwer@cwi.nl
Thu, 29 Jan 1998 02:08:24 +0100 (MET)


Today I started with "make xconfig", and could not save
the resulting config. Annoying.
* Replaced the fatal error in the wish script by an error printout.
* Fixed two gcc complaints.
* Removed the size spec for the processor type button (so that tcl/tk
can compute itself how much space "Pentium/K5/5x86/6x86" takes).
* Changed the choice for boolean questions from y/m/n to y - n.
That about xconfig. More fixing and polishing is required.

About kdev_t: improved ps2esdi.c and rocket.c.
I have not found other places where kdev_t is misused.

Andries

[PS - The error in "make xconfig" was caused by CONFIG_ULTRA,
which occurs in both branches of an if-then-else-fi.
The tcl/tk scripts cannot (yet) handle such a situation.]

Patch:

diff -u --recursive --new-file ../linux-2.1.82/linux/drivers/block/ps2esdi.c ./linux/drivers/block/ps2esdi.c
--- ../linux-2.1.82/linux/drivers/block/ps2esdi.c Wed Jan 28 19:46:00 1998
+++ ./linux/drivers/block/ps2esdi.c Wed Jan 28 19:50:18 1998
@@ -95,7 +95,7 @@
static int ps2esdi_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg);

-static int ps2esdi_reread_partitions(int dev);
+static int ps2esdi_reread_partitions(kdev_t dev);

static int ps2esdi_read_status_words(int num_words, int max_words, u_short * buffer);

@@ -1060,7 +1060,7 @@
int dev = DEVICE_NR(inode->i_rdev);

if (dev < ps2esdi_drives) {
- sync_dev(dev);
+ sync_dev(inode->i_rdev);
access_count[dev]--;
}
return 0;
@@ -1126,7 +1126,7 @@



-static int ps2esdi_reread_partitions(int dev)
+static int ps2esdi_reread_partitions(kdev_t dev)
{
int target = DEVICE_NR(dev);
int start = target << ps2esdi_gendisk.minor_shift;
diff -u --recursive --new-file ../linux-2.1.82/linux/drivers/char/rocket.c ./linux/drivers/char/rocket.c
--- ../linux-2.1.82/linux/drivers/char/rocket.c Sun Jan 4 19:55:08 1998
+++ ./linux/drivers/char/rocket.c Wed Jan 28 19:50:18 1998
@@ -224,7 +224,7 @@
static void rp_start(struct tty_struct *tty);

static inline int rocket_paranoia_check(struct r_port *info,
- dev_t device, const char *routine)
+ kdev_t device, const char *routine)
{
#ifdef ROCKET_PARANOIA_CHECK
static const char *badmagic =
diff -u --recursive --new-file ../linux-2.1.82/linux/drivers/net/arcnet.c ./linux/drivers/net/arcnet.c
--- ../linux-2.1.82/linux/drivers/net/arcnet.c Sat Nov 29 19:33:19 1997
+++ ./linux/drivers/net/arcnet.c Wed Jan 28 19:50:18 1998
@@ -1434,7 +1434,9 @@
struct ClientData *head = (struct ClientData *)skb->data;
struct device *dev=skb->dev;
struct arcnet_local *lp=(struct arcnet_local *)(dev->priv);
+#ifdef CONFIG_INET
int status;
+#endif

/*
* Only ARP and IP are currently supported
diff -u --recursive --new-file ../linux-2.1.82/linux/drivers/net/strip.c ./linux/drivers/net/strip.c
--- ../linux-2.1.82/linux/drivers/net/strip.c Thu Jan 15 23:33:06 1998
+++ ./linux/drivers/net/strip.c Wed Jan 28 19:50:18 1998
@@ -1630,11 +1630,9 @@

static int strip_rebuild_header(struct sk_buff *skb)
{
+#ifdef CONFIG_INET
STRIP_Header *header = (STRIP_Header *)skb->data;

- /*printk(KERN_INFO "%s: strip_rebuild_header\n", skb->dev->name);*/
-
-#ifdef CONFIG_INET
/* Arp find returns zero if if knows the address, */
/* or if it doesn't know the address it sends an ARP packet and returns non-zero */
return arp_find(header->dst_addr.c, skb)? 1 : 0;
diff -u --recursive --new-file ../linux-2.1.82/linux/scripts/header.tk ./linux/scripts/header.tk
--- ../linux-2.1.82/linux/scripts/header.tk Mon Jan 5 10:41:01 1998
+++ ./linux/scripts/header.tk Thu Jan 29 00:51:46 1998
@@ -237,7 +237,7 @@
then { puts $file1 "$varname=y"; \
puts $file2 "#define $varname 1" } \
else { \
- error "Attempting to write value for variable that is not configured ($varname)." \
+ puts stdout "ERROR - Attempting to write value for unconfigured variable ($varname)." \
}
}

@@ -281,7 +281,21 @@
pack $w.x$line.l -side right -fill both -expand on
}

-proc toggle_switch {w mnum line text variable} {
+proc toggle_switch2 {w mnum line text variable} {
+ frame $w.x$line -relief sunken
+ radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
+ -relief groove -width 2 -command "update_menu$mnum .menu$mnum"
+ radiobutton $w.x$line.m -text "-" -variable $variable -value 2 \
+ -relief groove -width 2 -command "update_menu$mnum .menu$mnum"
+ radiobutton $w.x$line.n -text "n" -variable $variable -value 0 \
+ -relief groove -width 2 -command "update_menu$mnum .menu$mnum"
+
+ option_name $w $mnum $line $text $variable
+
+ pack $w.x$line.n $w.x$line.m $w.x$line.y -side right -fill y
+}
+
+proc toggle_switch3 {w mnum line text variable} {
frame $w.x$line -relief sunken
radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
-relief groove -width 2 -command "update_menu$mnum .menu$mnum"
@@ -296,13 +310,13 @@
}

proc bool {w mnum line text variable} {
- toggle_switch $w $mnum $line $text $variable
+ toggle_switch2 $w $mnum $line $text $variable
$w.x$line.m configure -state disabled
pack $w.x$line -anchor w -fill both -expand on
}

proc tristate {w mnum line text variable } {
- toggle_switch $w $mnum $line $text $variable
+ toggle_switch3 $w $mnum $line $text $variable
pack $w.x$line -anchor w -fill both -expand on
}

@@ -336,7 +350,7 @@
frame $w.x$line
menubutton $w.x$line.x -textvariable $variable -menu \
$w.x$line.x.menu -relief raised \
- -width 15 -anchor w
+ -anchor w
option_name $w $mnum $line $text $helpidx
pack $w.x$line.x -anchor w -side right -fill y
pack $w.x$line -anchor w -fill both -expand on
diff -u --recursive --new-file ../linux-2.1.82/linux/scripts/tkgen.c ./linux/scripts/tkgen.c
--- ../linux-2.1.82/linux/scripts/tkgen.c Mon Jan 5 10:41:02 1998
+++ ./linux/scripts/tkgen.c Thu Jan 29 00:58:19 1998
@@ -685,7 +685,7 @@
int menu_maxlines = 0;
struct kconfig * cfg;
struct kconfig * cfg1 = NULL;
- char * menulabel;
+ char * menulabel = "tkgen error";

/*
* Start by assigning menu numbers, and submenu numbers.
diff -u --recursive --new-file ../linux-2.1.82/linux/scripts/tkparse.c ./linux/scripts/tkparse.c
--- ../linux-2.1.82/linux/scripts/tkparse.c Tue Dec 23 22:52:02 1997
+++ ./linux/scripts/tkparse.c Wed Jan 28 19:55:43 1998
@@ -578,7 +578,7 @@
char buffer[1024];
int offset;
int old_lineno;
- char * old_file;
+ char * old_file = 0; /* superfluous, just for gcc */
char * pnt;
FILE * infile;