diff options
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 1f3215ac085b..f54dab8acdcd 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -225,6 +225,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file, | |||
225 | * outside of main memory. | 225 | * outside of main memory. |
226 | * | 226 | * |
227 | */ | 227 | */ |
228 | #ifdef pgprot_noncached | ||
228 | static int uncached_access(struct file *file, unsigned long addr) | 229 | static int uncached_access(struct file *file, unsigned long addr) |
229 | { | 230 | { |
230 | #if defined(CONFIG_IA64) | 231 | #if defined(CONFIG_IA64) |
@@ -251,6 +252,7 @@ static int uncached_access(struct file *file, unsigned long addr) | |||
251 | return addr >= __pa(high_memory); | 252 | return addr >= __pa(high_memory); |
252 | #endif | 253 | #endif |
253 | } | 254 | } |
255 | #endif | ||
254 | 256 | ||
255 | static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 257 | static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
256 | unsigned long size, pgprot_t vma_prot) | 258 | unsigned long size, pgprot_t vma_prot) |
@@ -710,11 +712,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig) | |||
710 | switch (orig) { | 712 | switch (orig) { |
711 | case SEEK_CUR: | 713 | case SEEK_CUR: |
712 | offset += file->f_pos; | 714 | offset += file->f_pos; |
713 | if ((unsigned long long)offset < | ||
714 | (unsigned long long)file->f_pos) { | ||
715 | ret = -EOVERFLOW; | ||
716 | break; | ||
717 | } | ||
718 | case SEEK_SET: | 715 | case SEEK_SET: |
719 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ | 716 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ |
720 | if ((unsigned long long)offset >= ~0xFFFULL) { | 717 | if ((unsigned long long)offset >= ~0xFFFULL) { |
@@ -908,6 +905,9 @@ static int __init chr_dev_init(void) | |||
908 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); | 905 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); |
909 | 906 | ||
910 | mem_class = class_create(THIS_MODULE, "mem"); | 907 | mem_class = class_create(THIS_MODULE, "mem"); |
908 | if (IS_ERR(mem_class)) | ||
909 | return PTR_ERR(mem_class); | ||
910 | |||
911 | mem_class->devnode = mem_devnode; | 911 | mem_class->devnode = mem_devnode; |
912 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { | 912 | for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { |
913 | if (!devlist[minor].name) | 913 | if (!devlist[minor].name) |