Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbdIUGnd (ORCPT ); Thu, 21 Sep 2017 02:43:33 -0400 Received: from www17.your-server.de ([213.133.104.17]:34919 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669AbdIUGnb (ORCPT ); Thu, 21 Sep 2017 02:43:31 -0400 Subject: [PATCH 3/4] VFS: normal filesystems (and lustre): Cocci spatch "alloc_cast" From: Thomas Meyer To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Message-ID: <1505975570447-139396695-3-diffsplit-thomas@m3y3r.de> References: <1505975570447-826702259-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1505975570447-826702259-0-diffsplit-thomas@m3y3r.de> Date: Thu, 21 Sep 2017 08:33:46 +0200 X-Mailer: Evolution 3.22.6-1 Content-Transfer-Encoding: 7bit X-Authenticated-Sender: thomas@m3y3r.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 674 Lines: 19 Remove casting the values returned by memory allocation functions like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc." Found by coccinelle spatch "api/alloc/alloc_cast.cocci" Signed-off-by: Thomas Meyer --- diff -u -p a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -53,7 +53,7 @@ static struct kmem_cache * ncp_inode_cac static struct inode *ncp_alloc_inode(struct super_block *sb) { struct ncp_inode_info *ei; - ei = (struct ncp_inode_info *)kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL); + ei = kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode;