summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorRob Ward <robert.ward114@googlemail.com>2014-12-07 15:40:34 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 13:04:11 (GMT)
commita8c912522b547b3512cd25ccb8d507cd75264c84 (patch)
tree51d178c9873a7f17779c06339f49b87d61a96f2d /drivers/char
parent73f0718e74e25ac7381450a7a21257b8f26f43f0 (diff)
downloadlinux-a8c912522b547b3512cd25ccb8d507cd75264c84.tar.xz
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: Rob Ward <robert.ward114@googlemail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/mem.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 7d67784..17b2139 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -341,7 +341,6 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
return 0;
}
-#ifdef CONFIG_DEVKMEM
static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
{
unsigned long pfn;
@@ -362,9 +361,7 @@ static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
vma->vm_pgoff = pfn;
return mmap_mem(file, vma);
}
-#endif
-#ifdef CONFIG_DEVKMEM
/*
* 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,
*ppos = p;
return virtr + wrote ? : err;
}
-#endif
#ifdef CONFIG_DEVPORT
static ssize_t read_port(struct file *file, char __user *buf,
@@ -724,8 +720,7 @@ static const struct file_operations __maybe_unused mem_fops = {
.get_unmapped_area = get_unmapped_area_mem,
};
-#ifdef CONFIG_DEVKMEM
-static const struct file_operations kmem_fops = {
+static const struct file_operations __maybe_unused kmem_fops = {
.llseek = memory_lseek,
.read = read_kmem,
.write = write_kmem,
@@ -733,7 +728,6 @@ static const struct file_operations kmem_fops = {
.open = open_kmem,
.get_unmapped_area = get_unmapped_area_mem,
};
-#endif
static const struct file_operations null_fops = {
.llseek = null_lseek,