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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B57EC4332F for ; Tue, 20 Dec 2022 19:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233991AbiLTTRd (ORCPT ); Tue, 20 Dec 2022 14:17:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiLTTRb (ORCPT ); Tue, 20 Dec 2022 14:17:31 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64D5FE1A for ; Tue, 20 Dec 2022 11:17:30 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 22B456029A; Tue, 20 Dec 2022 19:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1671563849; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XHrlbZbAHx6HgiASBDYpw/iDxLRufFQU7asxqAEWK3M=; b=pn/XCSg76MsSHQppOLN/VMlHqKubJTEHSHwthyRvXCV9S13zi81VmXpA526UMgn5fRzk+V hxnDHEkUxOjMtIy8S0a63q3aQc8GzapASJ9A8HK9GGOz68Yx3T+O4MFUG6GxIv1u3QGY/S G1ZxEf3ff2YNBefh4GcK8/94Icnz+Q0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1671563849; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XHrlbZbAHx6HgiASBDYpw/iDxLRufFQU7asxqAEWK3M=; b=hNTtSe7DRqrRwoFUZKSeHLR1UbHQodx0A23AXzv5Hsz5MlXbQ7Onr+fCleQ3uor+HKfIRQ /ziCgl4wsS0hZ+Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 064B413254; Tue, 20 Dec 2022 19:17:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GAe1AEkKomPmOQAAMHmgww (envelope-from ); Tue, 20 Dec 2022 19:17:29 +0000 Date: Tue, 20 Dec 2022 20:16:43 +0100 From: David Sterba To: Josef Bacik Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 3/8] btrfs: fix uninit warning from get_inode_gen usage Message-ID: <20221220191643.GQ10499@twin.jikos.cz> Reply-To: dsterba@suse.cz References: 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-btrfs@vger.kernel.org On Fri, Dec 16, 2022 at 03:15:53PM -0500, Josef Bacik wrote: > Anybody that calls get_inode_gen() can have an uninitialized gen if > there's an error. This isn't a big deal because all the users just exit > if they get an error, however it makes -Wmaybe-uninitialized complain, > so fix this up to always init the passed in gen, this quiets all of the > uninitialized warnings in send.c. > > Signed-off-by: Josef Bacik > --- > fs/btrfs/send.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c > index 67f7c698ade3..25a235179edb 100644 > --- a/fs/btrfs/send.c > +++ b/fs/btrfs/send.c > @@ -955,14 +955,12 @@ static int get_inode_info(struct btrfs_root *root, u64 ino, > static int get_inode_gen(struct btrfs_root *root, u64 ino, u64 *gen) > { > int ret; > - struct btrfs_inode_info info; > + struct btrfs_inode_info info = {}; The { 0 } initializer should be used.