From f8314dc60ccba7e41f425048c4160dc7f63377d5 Mon Sep 17 00:00:00 2001 From: Panagiotis Issaris Date: Wed, 27 Sep 2006 01:49:37 -0700 Subject: [PATCH] fs: Conversions from kmalloc+memset to k(z|c)alloc Conversions from kmalloc+memset to kzalloc. Signed-off-by: Panagiotis Issaris Jffs2-bit-acked-by: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/lockd/host.c | 4 ++-- fs/lockd/svcsubs.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'fs/lockd') diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 703fb038c813..a0d0b58ce7a4 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -99,9 +99,9 @@ nlm_lookup_host(int server, struct sockaddr_in *sin, /* Ooops, no host found, create it */ dprintk("lockd: creating host entry\n"); - if (!(host = (struct nlm_host *) kmalloc(sizeof(*host), GFP_KERNEL))) + host = kzalloc(sizeof(*host), GFP_KERNEL); + if (!host) goto nohost; - memset(host, 0, sizeof(*host)); addr = sin->sin_addr.s_addr; sprintf(host->h_name, "%u.%u.%u.%u", NIPQUAD(addr)); diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 01b4db9e5466..a92dd98f8401 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -100,11 +100,10 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, nlm_debug_print_fh("creating file for", f); nfserr = nlm_lck_denied_nolocks; - file = (struct nlm_file *) kmalloc(sizeof(*file), GFP_KERNEL); + file = kzalloc(sizeof(*file), GFP_KERNEL); if (!file) goto out_unlock; - memset(file, 0, sizeof(*file)); memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); file->f_hash = hash; init_MUTEX(&file->f_sema); -- cgit v1.2.3