Skip to content

Commit 4183638

Browse files
committed
NOMMU: Delete askedalloc and realalloc variables
Delete the askedalloc and realalloc variables as nothing actually uses the value calculated. Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Mike Frysinger <vapier.adi@gmail.com> Acked-by: Paul Mundt <lethal@linux-sh.org>
1 parent 9c93af1 commit 4183638

1 file changed

Lines changed: 1 addition & 27 deletions

File tree

‎mm/nommu.c‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void *high_memory;
4040
struct page *mem_map;
4141
unsigned long max_mapnr;
4242
unsigned long num_physpages;
43-
unsigned long askedalloc, realalloc;
4443
atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
4544
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
4645
int sysctl_overcommit_ratio = 50; /* default is 50% */
@@ -1042,22 +1041,11 @@ unsigned long do_mmap_pgoff(struct file *file,
10421041
/* okay... we have a mapping; now we have to register it */
10431042
result = (void *) vma->vm_start;
10441043

1045-
if (vma->vm_flags & VM_MAPPED_COPY) {
1046-
realalloc += kobjsize(result);
1047-
askedalloc += len;
1048-
}
1049-
1050-
realalloc += kobjsize(vma);
1051-
askedalloc += sizeof(*vma);
1052-
10531044
current->mm->total_vm += len >> PAGE_SHIFT;
10541045

10551046
add_nommu_vma(vma);
10561047

10571048
shared:
1058-
realalloc += kobjsize(vml);
1059-
askedalloc += sizeof(*vml);
1060-
10611049
add_vma_to_mm(current->mm, vml);
10621050

10631051
up_write(&nommu_vma_sem);
@@ -1124,14 +1112,8 @@ static void put_vma(struct mm_struct *mm, struct vm_area_struct *vma)
11241112

11251113
/* IO memory and memory shared directly out of the pagecache from
11261114
* ramfs/tmpfs mustn't be released here */
1127-
if (vma->vm_flags & VM_MAPPED_COPY) {
1128-
realalloc -= kobjsize((void *) vma->vm_start);
1129-
askedalloc -= vma->vm_end - vma->vm_start;
1115+
if (vma->vm_flags & VM_MAPPED_COPY)
11301116
kfree((void *) vma->vm_start);
1131-
}
1132-
1133-
realalloc -= kobjsize(vma);
1134-
askedalloc -= sizeof(*vma);
11351117

11361118
if (vma->vm_file) {
11371119
fput(vma->vm_file);
@@ -1177,8 +1159,6 @@ int do_munmap(struct mm_struct *mm, unsigned long addr, size_t len)
11771159
put_vma(mm, vml->vma);
11781160

11791161
*parent = vml->next;
1180-
realalloc -= kobjsize(vml);
1181-
askedalloc -= sizeof(*vml);
11821162
kfree(vml);
11831163

11841164
update_hiwater_vm(mm);
@@ -1220,9 +1200,6 @@ void exit_mmap(struct mm_struct * mm)
12201200
while ((tmp = mm->context.vmlist)) {
12211201
mm->context.vmlist = tmp->next;
12221202
put_vma(mm, tmp->vma);
1223-
1224-
realalloc -= kobjsize(tmp);
1225-
askedalloc -= sizeof(*tmp);
12261203
kfree(tmp);
12271204
}
12281205

@@ -1276,9 +1253,6 @@ unsigned long do_mremap(unsigned long addr,
12761253
/* all checks complete - do it */
12771254
vma->vm_end = vma->vm_start + new_len;
12781255

1279-
askedalloc -= old_len;
1280-
askedalloc += new_len;
1281-
12821256
return vma->vm_start;
12831257
}
12841258
EXPORT_SYMBOL(do_mremap);

0 commit comments

Comments
 (0)