patch-2.3.6 linux/arch/i386/kernel/mca.c
Next file: linux/arch/i386/kernel/ptrace.c
Previous file: linux/arch/i386/defconfig
Back to the patch index
Back to the overall index
- Lines: 107
- Date:
Mon Jun 7 16:17:59 1999
- Orig file:
v2.3.5/linux/arch/i386/kernel/mca.c
- Orig date:
Mon May 10 13:00:10 1999
diff -u --recursive --new-file v2.3.5/linux/arch/i386/kernel/mca.c linux/arch/i386/kernel/mca.c
@@ -112,21 +112,25 @@
static ssize_t proc_mca_read(struct file*, char*, size_t, loff_t *);
static struct file_operations proc_mca_operations = {
- NULL, /* array_lseek */
- proc_mca_read, /* array_read */
- NULL, /* array_write */
- NULL, /* array_readdir */
- NULL, /* array_poll */
- NULL, /* array_ioctl */
+ NULL, /* llseek */
+ proc_mca_read, /* read */
+ NULL, /* write */
+ NULL, /* readdir */
+ NULL, /* poll */
+ NULL, /* ioctl */
NULL, /* mmap */
- NULL, /* no special open code */
+ NULL, /* open */
NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
+ NULL, /* release */
+ NULL, /* fsync */
+ NULL, /* fascync */
+ NULL, /* check_media_change */
+ NULL, /* revalidate */
+ NULL /* lock */
};
static struct inode_operations proc_mca_inode_operations = {
- &proc_mca_operations, /* default base directory file-ops */
+ &proc_mca_operations, /* default file-ops */
NULL, /* create */
NULL, /* lookup */
NULL, /* link */
@@ -142,7 +146,10 @@
NULL, /* writepage */
NULL, /* bmap */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL, /* updatepage */
+ NULL /* revalidate */
};
#endif
@@ -220,18 +227,19 @@
if(!MCA_bus)
return;
printk("Micro Channel bus detected.\n");
- save_flags(flags);
- cli();
/* Allocate MCA_info structure (at address divisible by 8) */
- mca_info = kmalloc(sizeof(struct MCA_info), GFP_KERNEL);
+ mca_info = (struct MCA_info *)kmalloc(sizeof(struct MCA_info), GFP_KERNEL);
if(mca_info == NULL) {
printk("Failed to allocate memory for mca_info!");
- restore_flags(flags);
return;
}
+ memset(mca_info, 0, sizeof(struct MCA_info));
+
+ save_flags(flags);
+ cli();
/* Make sure adapter setup is off */
@@ -705,12 +713,15 @@
mca_info->slot[i].dev = 0;
if(!mca_isadapter(i)) continue;
- node = kmalloc(sizeof(struct proc_dir_entry), GFP_KERNEL);
+
+ node = (struct proc_dir_entry *)kmalloc(sizeof(struct proc_dir_entry), GFP_KERNEL);
if(node == NULL) {
printk("Failed to allocate memory for MCA proc-entries!");
return;
}
+ memset(node, 0, sizeof(struct proc_dir_entry));
+
if(i < MCA_MAX_SLOT_NR) {
node->low_ino = PROC_MCA_SLOT + i;
node->namelen = sprintf(mca_info->slot[i].procname,
@@ -854,7 +865,7 @@
type = inode->i_ino;
pid = type >> 16;
type &= 0x0000ffff;
- start = 0;
+ start = NULL;
dp = (struct proc_dir_entry *) inode->u.generic_ip;
length = mca_fill((char *) page, pid, type,
&start, ppos, count);
@@ -862,7 +873,7 @@
free_page(page);
return length;
}
- if(start != 0) {
+ if(start != NULL) {
/* We have had block-adjusting processing! */
copy_to_user(buf, start, length);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)