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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 AA52BC43460 for ; Mon, 10 May 2021 13:50:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9225C61581 for ; Mon, 10 May 2021 13:50:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239153AbhEJNtx (ORCPT ); Mon, 10 May 2021 09:49:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:47256 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237505AbhEJNmN (ORCPT ); Mon, 10 May 2021 09:42:13 -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 1164EB0BE; Mon, 10 May 2021 13:41:04 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 39C57DB226; Mon, 10 May 2021 15:38:35 +0200 (CEST) Date: Mon, 10 May 2021 15:38:35 +0200 From: David Sterba To: Johannes Thumshirn Cc: Jiapeng Chong , "clm@fb.com" , "josef@toxicpanda.com" , "dsterba@suse.com" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] btrfs: Assign boolean values to a bool variable Message-ID: <20210510133835.GU7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Johannes Thumshirn , Jiapeng Chong , "clm@fb.com" , "josef@toxicpanda.com" , "dsterba@suse.com" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1614764728-14857-1-git-send-email-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 09:37:58AM +0000, Johannes Thumshirn wrote: > On 04/03/2021 02:51, Jiapeng Chong wrote: > > Fix the following coccicheck warnings: > > > > ./fs/btrfs/volumes.c:1462:10-11: WARNING: return of 0/1 in function > > 'dev_extent_hole_check_zoned' with return type bool. > > > > Reported-by: Abaci Robot > > Signed-off-by: Jiapeng Chong > > --- > > fs/btrfs/volumes.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > > index bc3b33e..995920f 100644 > > --- a/fs/btrfs/volumes.c > > +++ b/fs/btrfs/volumes.c > > @@ -1458,8 +1458,8 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device, > > /* Given hole range was invalid (outside of device) */ > > if (ret == -ERANGE) { > > *hole_start += *hole_size; > > - *hole_size = 0; > > - return 1; > > + *hole_size = false; > > > Erm, hole_size is u64 and not bool Thanks for catching it, I should have spotted that.