Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2440296ybg; Thu, 30 Jul 2020 22:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzq0mYZzde9e/cZFl3dacDrLUOKWFiouCsQOaIEhNha2EH/S0tl8KKos/WNb1uIRlUmqI9 X-Received: by 2002:a50:fb94:: with SMTP id e20mr2253119edq.103.1596173131882; Thu, 30 Jul 2020 22:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596173131; cv=none; d=google.com; s=arc-20160816; b=O3gNtyMMWo9ZrTQ6AsjWcvmdPTgBNmks/dbjdCOmyc2WHfWbpBI6fIwQ6m4jqmHLe/ WIHaw4W8iWWNtOw9tSqfHyW0kZXEdiaRsUsQepUfV00rQmqVwMhyXgtfjSk1dgPDVid0 w7VbvbFAiWeIiYKn6NN2UceEES3WWTjWz6WKxEc2CRLgkl5DoG6bia6gwR75KPFoBX8X HJK7TPBDTcmCUKpmCNNO4GtJwBee7aMJbuzHFa/ibaPH9duLUxW65qEoU8lpYAHUk6HG WBoqSBcLP8RFUVL0LaOUSMsjOeDNMZcPiVF2SqgVTAgF7pDxQqRs99gZW5h4rVArM60b +WHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tPkDg+BkG+CmhSLlb1RqgR//w/3VyVvVztpDyJjNyPM=; b=0bfZ7jloYbCEhklqJKy8VFsA+5dDueK0qZ3FpNgaRYBxT1asQ0P9kaHmAxvaExtzSX f3EYRSd4xe4VOviUGar0rakkvlK2QBATNQ3DPQWlrSvO612gdi8SZ50cB8kVFUmN/Zei T4sV3tQl+axxlvf+Una5hYen3ImkqANQrQZy2yGgPydI9aOsUA2GYjazQs/tdCU9RBKx cRZnY2+77JR+9DLfNGB9Ypv2/D8fTQYFZPtJozRUA5noRZBm67/qZiR2lqboRnRbWFQ6 yA1dkjk0dH3/ZbhM4a4G+/oyZUMbvE2t778jwtEIOsqB/A6B4c7nz7PSMERq/wzoJESG 39Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by9si4409686edb.241.2020.07.30.22.25.04; Thu, 30 Jul 2020 22:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730952AbgGaFYi (ORCPT + 99 others); Fri, 31 Jul 2020 01:24:38 -0400 Received: from nautica.notk.org ([91.121.71.147]:57207 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729519AbgGaFYi (ORCPT ); Fri, 31 Jul 2020 01:24:38 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 5DC4FC01C; Fri, 31 Jul 2020 07:24:36 +0200 (CEST) Date: Fri, 31 Jul 2020 07:24:21 +0200 From: Dominique Martinet To: Li Heng Cc: ericvh@gmail.com, lucho@ionkov.net, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] 9p: Remove unneeded cast from memory allocation Message-ID: <20200731052421.GA22875@nautica> References: <1596013140-49744-1-git-send-email-liheng40@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1596013140-49744-1-git-send-email-liheng40@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Li Heng wrote on Wed, Jul 29, 2020: > Remove casting the values returned by memory allocation function. > > Coccinelle emits WARNING: > > ./fs/9p/vfs_inode.c:226:12-29: WARNING: casting value returned by memory allocation function to (struct v9fs_inode *) is useless. > > Signed-off-by: Li Heng Why not, I'll take this for next. Please pay a bit more attention to the commit message next time though, neither "Remove casting the values" nor "x emits warning" are proper English -- I've taken the liberty to fix the grammar a bit... > --- > fs/9p/vfs_inode.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c > index 0fd5bf2..ae0c38a 100644 > --- a/fs/9p/vfs_inode.c > +++ b/fs/9p/vfs_inode.c > @@ -223,8 +223,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat) > struct inode *v9fs_alloc_inode(struct super_block *sb) > { > struct v9fs_inode *v9inode; > - v9inode = (struct v9fs_inode *)kmem_cache_alloc(v9fs_inode_cache, > - GFP_KERNEL); > + v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL); > if (!v9inode) > return NULL; > #ifdef CONFIG_9P_FSCACHE