From f52720ca5f48574e347dff35ffe6b389ace61537 Mon Sep 17 00:00:00 2001 From: Panagiotis Issaris Date: Wed, 27 Sep 2006 01:49:39 -0700 Subject: [PATCH] fs: Removing useless casts * Removing useless casts * Removing useless wrapper * Conversion from kmalloc+memset to kzalloc Signed-off-by: Panagiotis Issaris Acked-by: Dave Kleikamp Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/nfs/delegation.c | 7 +------ fs/nfs/inode.c | 2 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/proc.c | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) (limited to 'fs/nfs') diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 57133678db16..841c99a9b11c 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -20,11 +20,6 @@ #include "delegation.h" #include "internal.h" -static struct nfs_delegation *nfs_alloc_delegation(void) -{ - return (struct nfs_delegation *)kmalloc(sizeof(struct nfs_delegation), GFP_KERNEL); -} - static void nfs_free_delegation(struct nfs_delegation *delegation) { if (delegation->cred) @@ -124,7 +119,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) __nfs_revalidate_inode(NFS_SERVER(inode), inode); - delegation = nfs_alloc_delegation(); + delegation = kmalloc(sizeof(*delegation), GFP_KERNEL); if (delegation == NULL) return -ENOMEM; memcpy(delegation->stateid.data, res->delegation.data, diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e8c143d182c4..a9d0f71eb5f7 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -443,7 +443,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str { struct nfs_open_context *ctx; - ctx = (struct nfs_open_context *)kmalloc(sizeof(*ctx), GFP_KERNEL); + ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); if (ctx != NULL) { atomic_set(&ctx->count, 1); ctx->dentry = dget(dentry); diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index f8688eaa0001..3b234d4601e7 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -449,7 +449,7 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr struct nfs_fattr res; } *ptr; - ptr = (struct unlinkxdr *)kmalloc(sizeof(*ptr), GFP_KERNEL); + ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); if (!ptr) return -ENOMEM; ptr->arg.fh = NFS_FH(dir->d_inode); diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 630e50647bbb..4529cc4f3f8f 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -352,7 +352,7 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr * { struct nfs_diropargs *arg; - arg = (struct nfs_diropargs *)kmalloc(sizeof(*arg), GFP_KERNEL); + arg = kmalloc(sizeof(*arg), GFP_KERNEL); if (!arg) return -ENOMEM; arg->fh = NFS_FH(dir->d_inode); -- cgit v1.2.3