Commit a8c91252 authored by Rob Ward's avatar Rob Ward Committed by Greg Kroah-Hartman

drivers: char: mem: Simplify DEVKMEM configuration

Simplify the use of CONFIG_DEVKMEM by making the kmem_fops
so that it is __maybe_unused.

This enabled the multiple #ifdef's used for this structure
to be removed and brings it in line with the use of CONFIG_DEVMEM

This change should introduce no functional changes.
Signed-off-by: default avatarRob Ward <robert.ward114@googlemail.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73f0718e
...@@ -341,7 +341,6 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma) ...@@ -341,7 +341,6 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
return 0; return 0;
} }
#ifdef CONFIG_DEVKMEM
static int mmap_kmem(struct file *file, struct vm_area_struct *vma) static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
{ {
unsigned long pfn; unsigned long pfn;
...@@ -362,9 +361,7 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma) ...@@ -362,9 +361,7 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
vma->vm_pgoff = pfn; vma->vm_pgoff = pfn;
return mmap_mem(file, vma); return mmap_mem(file, vma);
} }
#endif
#ifdef CONFIG_DEVKMEM
/* /*
* This function reads the *virtual* memory as seen by the kernel. * This function reads the *virtual* memory as seen by the kernel.
*/ */
...@@ -544,7 +541,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, ...@@ -544,7 +541,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
*ppos = p; *ppos = p;
return virtr + wrote ? : err; return virtr + wrote ? : err;
} }
#endif
#ifdef CONFIG_DEVPORT #ifdef CONFIG_DEVPORT
static ssize_t read_port(struct file *file, char __user *buf, static ssize_t read_port(struct file *file, char __user *buf,
...@@ -724,8 +720,7 @@ static const struct file_operations __maybe_unused mem_fops = { ...@@ -724,8 +720,7 @@ static const struct file_operations __maybe_unused mem_fops = {
.get_unmapped_area = get_unmapped_area_mem, .get_unmapped_area = get_unmapped_area_mem,
}; };
#ifdef CONFIG_DEVKMEM static const struct file_operations __maybe_unused kmem_fops = {
static const struct file_operations kmem_fops = {
.llseek = memory_lseek, .llseek = memory_lseek,
.read = read_kmem, .read = read_kmem,
.write = write_kmem, .write = write_kmem,
...@@ -733,7 +728,6 @@ static const struct file_operations kmem_fops = { ...@@ -733,7 +728,6 @@ static const struct file_operations kmem_fops = {
.open = open_kmem, .open = open_kmem,
.get_unmapped_area = get_unmapped_area_mem, .get_unmapped_area = get_unmapped_area_mem,
}; };
#endif
static const struct file_operations null_fops = { static const struct file_operations null_fops = {
.llseek = null_lseek, .llseek = null_lseek,
......
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