From patchwork Tue Jun 10 14:49:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4329491 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C0A96BEEAA for ; Tue, 10 Jun 2014 14:49:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A41120340 for ; Tue, 10 Jun 2014 14:49:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3461220306 for ; Tue, 10 Jun 2014 14:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbaFJOt2 (ORCPT ); Tue, 10 Jun 2014 10:49:28 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:36121 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbaFJOtZ (ORCPT ); Tue, 10 Jun 2014 10:49:25 -0400 Received: by mail-pb0-f48.google.com with SMTP id rr13so6307948pbb.7 for ; Tue, 10 Jun 2014 07:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=5t7/y1IRwIHm201qI+783AfkJoroKvTBBUC0Fd8taTA=; b=BVj5LXyU657LGMRrWaSftiJ2cNR2jDvdFN9HL3d7Nd63LPPq6oT6/Th4kKDoy0JoyT khWcAr9cEMhCGm3c4QyZ685V0cwhbWqeibv85zV3qC9jbO07FZWUCOaE26Wa+RH9aK8z KxMPSg02p95RqMt9yUc2oI4c/G4Dk9LO2tcPWG5TR0llIIJ1MZcj6wmgDRZB19tS475/ 5QZtuwnTwL7fR1XbdeNy4Dl1skP3SrvIJn0RK2Ceq/VbHBHCjUJjGncDbG/CbRmnokuY +owIUpvtARhGMrA3pctdcVsrMsSW95bFoh2f7FUpcBEM+eDVo5c31jcXyAjt5vpmawJe KZCg== X-Received: by 10.68.253.73 with SMTP id zy9mr12415731pbc.114.1402411765505; Tue, 10 Jun 2014 07:49:25 -0700 (PDT) Received: from localhost ([122.178.68.36]) by mx.google.com with ESMTPSA id zb2sm69943199pbb.45.2014.06.10.07.49.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:49:24 -0700 (PDT) Date: Tue, 10 Jun 2014 20:19:17 +0530 From: Himangi Saraogi To: Trond Myklebust , "J. Bruce Fields" , "David S. Miller" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH] rpc_pipe: Drop memory allocation cast Message-ID: <20140610144917.GA3374@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop cast on the result of kmalloc and similar functions. The semantic patch that makes this change is as follows: // @@ type T; @@ - (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)) // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- net/sunrpc/rpc_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index b185548..2d12b76 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -195,7 +195,7 @@ static struct inode * rpc_alloc_inode(struct super_block *sb) { struct rpc_inode *rpci; - rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL); + rpci = kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL); if (!rpci) return NULL; return &rpci->vfs_inode;