Commit 09952a58 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix build with CONFIG_KCORE_AOUT

We get a linkage error with CONFIG_KCORE_AOUT because there is no
implementation of kclist_add() and kclist_del().

Also fix a warning in the a.out version of read_kcore().

Maybe we should just remove kcore a.out support.  m68knommu and h8300 are
setting CONFIG_KCORE_AOUT in their defconfigs though.
parent 22cfa91b
......@@ -35,9 +35,10 @@ struct file_operations proc_kcore_operations = {
};
#ifdef CONFIG_KCORE_AOUT
static ssize_t read_kcore(struct file *file, char *buf, size_t count, loff_t *ppos)
static ssize_t read_kcore(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
unsigned long long p = *ppos, memsize;
loff_t p = *ppos, memsize;
ssize_t read;
ssize_t count1;
char * pnt;
......@@ -90,7 +91,8 @@ static ssize_t read_kcore(struct file *file, char *buf, size_t count, loff_t *pp
read += count1;
}
if (count > 0) {
if (copy_to_user(buf, (void *) (PAGE_OFFSET+p-PAGE_SIZE), count))
if (copy_to_user(buf,
(void *)(PAGE_OFFSET + (long)p - PAGE_SIZE), count))
return -EFAULT;
read += count;
}
......
......@@ -182,12 +182,6 @@ static inline void proc_net_remove(const char *name)
remove_proc_entry(name,proc_net);
}
/*
* fs/proc/kcore.c
*/
extern void kclist_add(struct kcore_list *, void *, size_t);
extern struct kcore_list *kclist_del(void *);
#else
#define proc_root_driver NULL
......@@ -223,6 +217,9 @@ static inline void proc_tty_unregister_driver(struct tty_driver *driver) {};
extern struct proc_dir_entry proc_root;
#endif /* CONFIG_PROC_FS */
#if !defined(CONFIG_PROC_FS) || defined(CONFIG_KCORE_AOUT)
static inline void kclist_add(struct kcore_list *new, void *addr, size_t size)
{
}
......@@ -230,8 +227,10 @@ static inline struct kcore_list * kclist_del(void *addr)
{
return NULL;
}
#endif /* CONFIG_PROC_FS */
#else
extern void kclist_add(struct kcore_list *, void *, size_t);
extern struct kcore_list *kclist_del(void *);
#endif
struct proc_inode {
struct task_struct *task;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment