lkml.org 
[lkml]   [2022]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] pstore/zone: Remove unnecessary memset when using kcalloc()
Date
zones is allocated by kcalloc(). The memory is already set to
zero. It is unnecessary to call memset again.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
fs/pstore/zone.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index 7c8f8feac6c3..27ee216345a5 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -1215,7 +1215,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
pr_err("allocate for zones %s failed\n", name);
return ERR_PTR(-ENOMEM);
}
- memset(zones, 0, c * sizeof(*zones));

for (i = 0; i < c; i++) {
zone = psz_init_zone(type, off, record_size);
--
2.7.4
\
 
 \ /
  Last update: 2022-04-15 11:53    [W:0.043 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site