From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A527FC47420 for ; Mon, 28 Sep 2020 14:02:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 598F921941 for ; Mon, 28 Sep 2020 14:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601301751; bh=Vobqy5ZNV0BItrof3qaTmqtMGSa+AIkCaHcPJTyJEZU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:List-ID: From; b=jMvqKgQp21rQfeQsqnIW+nWsFZbum2pbm8iemcqcHZmChohgtm/fWydN6oYecLyp3 MmhYc7GVZVHxi/76+X5HcfZsBPltwQISkhslWIAMVWJHfldd+uqaKqnsmcfCp6Cjr3 +nKkTEANtFQoK0Nw9oWm+J/B+k3jYCZZD/nSrDr4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbgI1OCa (ORCPT ); Mon, 28 Sep 2020 10:02:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:36874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgI1OC3 (ORCPT ); Mon, 28 Sep 2020 10:02:29 -0400 Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64DAA21548; Mon, 28 Sep 2020 14:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601301749; bh=Vobqy5ZNV0BItrof3qaTmqtMGSa+AIkCaHcPJTyJEZU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=nyKO0gGTF1gQl/tmCdVhkfepP6Z8kCkb9CuDuRynWwrxhlj+0+s0JSJbiniZ5VPaK oSwrhuTkr5TQLWXwTWXb7RFjiUTNKTMCzwLPFQFogPOWuTdWRG0o6ylAj1GfcqhwWY x5FjpEbSZ7q2fagVjNoXRCXTZu9t8o/uTJ5tib00= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 2C91D352077A; Mon, 28 Sep 2020 07:02:29 -0700 (PDT) Date: Mon, 28 Sep 2020 07:02:29 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Julia Lawall , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , rcu@vger.kernel.org Subject: Re: [PATCH] kvfree_rcu(): fix ifnullfree.cocci warnings Message-ID: <20200928140229.GO29330@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200927225519.GB2800828@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200927225519.GB2800828@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 27, 2020 at 06:55:19PM -0400, Joel Fernandes wrote: > On Sun, Sep 27, 2020 at 03:00:29PM +0200, Julia Lawall wrote: > > From: kernel test robot > > > > NULL check before kfree is not needed. > > > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > > > Fixes: e9bed2a1239b ("kvfree_rcu(): Switch to kmalloc() and kfree() for allocations") > > Signed-off-by: kernel test robot > > Signed-off-by: Julia Lawall > > --- > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git urezki-pcount.2020.09.26a > > head: 1a8eee1cc5b0e59c17f5d94c5871e6c70c4a43a1 > > commit: e9bed2a1239b017d78cec5de66adce0560f6d077 [17/18] kvfree_rcu(): Switch to kmalloc() and kfree() for allocations > > :::::: branch date: 4 hours ago > > :::::: commit date: 15 hours ago > > > > tree.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -3165,8 +3165,7 @@ static void kfree_rcu_work(struct work_s > > bkvhead[i] = NULL; > > krc_this_cpu_unlock(krcp, flags); > > > > - if (bkvhead[i]) > > - kfree(bkvhead[i]); > > + kfree(bkvhead[i]); > > > > Acked-by: Joel Fernandes (Google) Applied and pushed, thank you both! Thanx, Paul > thanks, > > - Joel > > > cond_resched_tasks_rcu_qs(); > > } From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2527444938223694977==" MIME-Version: 1.0 From: Paul E. McKenney To: kbuild-all@lists.01.org Subject: Re: [PATCH] kvfree_rcu(): fix ifnullfree.cocci warnings Date: Mon, 28 Sep 2020 07:02:29 -0700 Message-ID: <20200928140229.GO29330@paulmck-ThinkPad-P72> In-Reply-To: <20200927225519.GB2800828@google.com> List-Id: --===============2527444938223694977== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sun, Sep 27, 2020 at 06:55:19PM -0400, Joel Fernandes wrote: > On Sun, Sep 27, 2020 at 03:00:29PM +0200, Julia Lawall wrote: > > From: kernel test robot > > = > > NULL check before kfree is not needed. > > = > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > = > > Fixes: e9bed2a1239b ("kvfree_rcu(): Switch to kmalloc() and kfree() for= allocations") > > Signed-off-by: kernel test robot > > Signed-off-by: Julia Lawall > > --- > > = > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-r= cu.git urezki-pcount.2020.09.26a > > head: 1a8eee1cc5b0e59c17f5d94c5871e6c70c4a43a1 > > commit: e9bed2a1239b017d78cec5de66adce0560f6d077 [17/18] kvfree_rcu(): = Switch to kmalloc() and kfree() for allocations > > :::::: branch date: 4 hours ago > > :::::: commit date: 15 hours ago > > = > > tree.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > = > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -3165,8 +3165,7 @@ static void kfree_rcu_work(struct work_s > > bkvhead[i] =3D NULL; > > krc_this_cpu_unlock(krcp, flags); > > = > > - if (bkvhead[i]) > > - kfree(bkvhead[i]); > > + kfree(bkvhead[i]); > > = > = > Acked-by: Joel Fernandes (Google) Applied and pushed, thank you both! Thanx, Paul > thanks, > = > - Joel > = > > cond_resched_tasks_rcu_qs(); > > } --===============2527444938223694977==--