Skip to content

Commit b593e48

Browse files
yanburmanLinus Torvalds
authored andcommitted
[PATCH] affs: replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <burman.yan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 4d2d3ce commit b593e48

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎fs/affs/bitmap.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,11 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
289289
sbi->s_bmap_count = (sbi->s_partition_size - sbi->s_reserved +
290290
sbi->s_bmap_bits - 1) / sbi->s_bmap_bits;
291291
size = sbi->s_bmap_count * sizeof(*bm);
292-
bm = sbi->s_bitmap = kmalloc(size, GFP_KERNEL);
292+
bm = sbi->s_bitmap = kzalloc(size, GFP_KERNEL);
293293
if (!sbi->s_bitmap) {
294294
printk(KERN_ERR "AFFS: Bitmap allocation failed\n");
295295
return -ENOMEM;
296296
}
297-
memset(sbi->s_bitmap, 0, size);
298297

299298
bmap_blk = (__be32 *)sbi->s_root_bh->b_data;
300299
blk = sb->s_blocksize / 4 - 49;

‎fs/afs/server.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ int afs_server_lookup(struct afs_cell *cell, const struct in_addr *addr,
5555
_enter("%p,%08x,", cell, ntohl(addr->s_addr));
5656

5757
/* allocate and initialise a server record */
58-
server = kmalloc(sizeof(struct afs_server), GFP_KERNEL);
58+
server = kzalloc(sizeof(struct afs_server), GFP_KERNEL);
5959
if (!server) {
6060
_leave(" = -ENOMEM");
6161
return -ENOMEM;
6262
}
6363

64-
memset(server, 0, sizeof(struct afs_server));
6564
atomic_set(&server->usage, 1);
6665

6766
INIT_LIST_HEAD(&server->link);

‎fs/afs/super.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,12 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent)
242242
kenter("");
243243

244244
/* allocate a superblock info record */
245-
as = kmalloc(sizeof(struct afs_super_info), GFP_KERNEL);
245+
as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL);
246246
if (!as) {
247247
_leave(" = -ENOMEM");
248248
return -ENOMEM;
249249
}
250250

251-
memset(as, 0, sizeof(struct afs_super_info));
252-
253251
afs_get_volume(params->volume);
254252
as->volume = params->volume;
255253

0 commit comments

Comments
 (0)