Skip to content

Commit

Permalink
[PATCH] Get rid of "double zeroing" of allocated pages
Browse files Browse the repository at this point in the history
Simplify the few instances where a call to "get_zeroed_page()" is closely
followed by an unnecessary call to memset() to clear that page.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Cc: chas williams <chas@cmf.nrl.navy.mil>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Robert P. J. Day authored and Linus Torvalds committed Feb 11, 2007
1 parent 78ba2fa commit aa58d61
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion drivers/atm/eni.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,6 @@ static int start_rx(struct atm_dev *dev)
free_page((unsigned long) eni_dev->free_list);
return -ENOMEM;
}
memset(eni_dev->rx_map,0,PAGE_SIZE);
eni_dev->rx_mult = DEFAULT_RX_MULT;
eni_dev->fast = eni_dev->last_fast = NULL;
eni_dev->slow = eni_dev->last_slow = NULL;
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ jpg_fbuffer_alloc (struct file *file)
jpg_fbuffer_free(file);
return -ENOBUFS;
}
memset((void *) mem, 0, PAGE_SIZE);
fh->jpg_buffers.buffer[i].frag_tab = (u32 *) mem;
fh->jpg_buffers.buffer[i].frag_tab_bus =
virt_to_bus((void *) mem);
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/53c7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3099,7 +3099,6 @@ allocate_cmd (Scsi_Cmnd *cmd) {
real = get_zeroed_page(GFP_ATOMIC);
if (real == 0)
return NULL;
memset((void *)real, 0, 4096);
cache_push(virt_to_phys((void *)real), 4096);
cache_clear(virt_to_phys((void *)real), 4096);
kernel_set_cachemode((void *)real, 4096, IOMAP_NOCACHE_SER);
Expand Down

0 comments on commit aa58d61

Please sign in to comment.