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=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 3D113C2D0A3 for ; Thu, 29 Oct 2020 20:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9D0020738 for ; Thu, 29 Oct 2020 20:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgJ2Ux3 (ORCPT ); Thu, 29 Oct 2020 16:53:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:33080 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgJ2Ux3 (ORCPT ); Thu, 29 Oct 2020 16:53:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 90625ACD8; Thu, 29 Oct 2020 20:53:27 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id E7790DA7CE; Thu, 29 Oct 2020 21:51:51 +0100 (CET) Date: Thu, 29 Oct 2020 21:51:50 +0100 From: David Sterba To: Dan Carpenter Cc: Chris Mason , Qu Wenruo , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] btrfs: clean up NULL checks in qgroup_unreserve_range() Message-ID: <20201029205150.GW6756@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Dan Carpenter , Chris Mason , Qu Wenruo , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20201023112633.GE282278@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201023112633.GE282278@mwanda> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Oct 23, 2020 at 02:26:33PM +0300, Dan Carpenter wrote: > Smatch complains that this code dereferences "entry" before checking > whether it's NULL on the next line. Fortunately, rb_entry() will never > return NULL so it doesn't cause a problem. We can clean up the NULL > checking a bit to silence the warning and make the code more clear. > > Signed-off-by: Dan Carpenter Added to misc-next, thanks.