diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-12-06 23:40:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:45 -0500 |
commit | b593e48d2bf09c40c0f5165f2f2a10cc3983ea51 (patch) | |
tree | 5eba2dd937d9ce14790776542a2835c8e19e2c2f /fs/afs | |
parent | 4d2d3cec1da18123b301270381eb748e5ba4f638 (diff) |
[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>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/server.c | 3 | ||||
-rw-r--r-- | fs/afs/super.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/fs/afs/server.c b/fs/afs/server.c index 22afaae1a4ce..44aff81dc6a7 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c | |||
@@ -55,13 +55,12 @@ int afs_server_lookup(struct afs_cell *cell, const struct in_addr *addr, | |||
55 | _enter("%p,%08x,", cell, ntohl(addr->s_addr)); | 55 | _enter("%p,%08x,", cell, ntohl(addr->s_addr)); |
56 | 56 | ||
57 | /* allocate and initialise a server record */ | 57 | /* allocate and initialise a server record */ |
58 | server = kmalloc(sizeof(struct afs_server), GFP_KERNEL); | 58 | server = kzalloc(sizeof(struct afs_server), GFP_KERNEL); |
59 | if (!server) { | 59 | if (!server) { |
60 | _leave(" = -ENOMEM"); | 60 | _leave(" = -ENOMEM"); |
61 | return -ENOMEM; | 61 | return -ENOMEM; |
62 | } | 62 | } |
63 | 63 | ||
64 | memset(server, 0, sizeof(struct afs_server)); | ||
65 | atomic_set(&server->usage, 1); | 64 | atomic_set(&server->usage, 1); |
66 | 65 | ||
67 | INIT_LIST_HEAD(&server->link); | 66 | INIT_LIST_HEAD(&server->link); |
diff --git a/fs/afs/super.c b/fs/afs/super.c index 9a351c4c7564..18d9b77ba40f 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c | |||
@@ -242,14 +242,12 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent) | |||
242 | kenter(""); | 242 | kenter(""); |
243 | 243 | ||
244 | /* allocate a superblock info record */ | 244 | /* 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); |
246 | if (!as) { | 246 | if (!as) { |
247 | _leave(" = -ENOMEM"); | 247 | _leave(" = -ENOMEM"); |
248 | return -ENOMEM; | 248 | return -ENOMEM; |
249 | } | 249 | } |
250 | 250 | ||
251 | memset(as, 0, sizeof(struct afs_super_info)); | ||
252 | |||
253 | afs_get_volume(params->volume); | 251 | afs_get_volume(params->volume); |
254 | as->volume = params->volume; | 252 | as->volume = params->volume; |
255 | 253 | ||