From 364d8da86a32b4e59c0aeda82bd8dbbd7ebcda97 Mon Sep 17 00:00:00 2001 From: Vasant Hegde Date: Sun, 28 Apr 2013 18:43:56 +0000 Subject: [PATCH] --- yaml --- r: 370877 b: refs/heads/master c: fb4696c39573ea97d0aeb94fdcdbccba4607b49f h: refs/heads/master i: 370875: 3d99ca637162d0953723e159888d88668e2111b9 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/rtas_flash.c | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index b917cd695690..02aacde59558 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f3a90e89d2503ce4c40159526e446f1fca92f10 +refs/heads/master: fb4696c39573ea97d0aeb94fdcdbccba4607b49f diff --git a/trunk/arch/powerpc/kernel/rtas_flash.c b/trunk/arch/powerpc/kernel/rtas_flash.c index a3e4034b6843..243e184cbe45 100644 --- a/trunk/arch/powerpc/kernel/rtas_flash.c +++ b/trunk/arch/powerpc/kernel/rtas_flash.c @@ -286,12 +286,6 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf, return simple_read_from_buffer(buf, count, ppos, msg, strlen(msg)); } -/* constructor for flash_block_cache */ -void rtas_block_ctor(void *ptr) -{ - memset(ptr, 0, RTAS_BLK_SIZE); -} - /* We could be much more efficient here. But to keep this function * simple we allocate a page to the block list no matter how small the * count is. If the system is low on memory it will be just as well @@ -316,7 +310,7 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, * proc file */ if (uf->flist == NULL) { - uf->flist = kmem_cache_alloc(flash_block_cache, GFP_KERNEL); + uf->flist = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL); if (!uf->flist) return -ENOMEM; } @@ -327,7 +321,7 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, next_free = fl->num_blocks; if (next_free == FLASH_BLOCKS_PER_NODE) { /* Need to allocate another block_list */ - fl->next = kmem_cache_alloc(flash_block_cache, GFP_KERNEL); + fl->next = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL); if (!fl->next) return -ENOMEM; fl = fl->next; @@ -336,7 +330,7 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, if (count > RTAS_BLK_SIZE) count = RTAS_BLK_SIZE; - p = kmem_cache_alloc(flash_block_cache, GFP_KERNEL); + p = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL); if (!p) return -ENOMEM; @@ -786,7 +780,7 @@ static int __init rtas_flash_init(void) flash_block_cache = kmem_cache_create("rtas_flash_cache", RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0, - rtas_block_ctor); + NULL); if (!flash_block_cache) { printk(KERN_ERR "%s: failed to create block cache\n", __func__);