Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5158996ybe; Tue, 17 Sep 2019 03:43:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKw0SW25gMZHXhJ/SyJTaw6tozBj6LyvfPv4pdB+Xx56uZu2gWLHTJzJ8WtklcdcKF4OQ5 X-Received: by 2002:a50:b582:: with SMTP id a2mr3932693ede.98.1568717001856; Tue, 17 Sep 2019 03:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568717001; cv=none; d=google.com; s=arc-20160816; b=QDuTPC041zV5/Oqervo7oVrqbr0jfuFFalDay30q0EE1qk03vZp/8yKpZFSjpHdOp8 KL5i952UPgN2UDmd18uxdpDpFZpOZZ1PVR/kAIMVRQNlS4Cn5Ghp1eeQOq3gHjVA2V/k zGpv5Dr7KnoUsRVnqb4xJIHa1tG9S4BfhJ4ci6xjwLRyoti//tTASB1ckfs7kDuCtliZ 8fk7oOAsmW4XdDWU72XsdEx6c3qfwnNFxj1/F+7lPOa7lCnrLx3FL21oyCJ9Ln+8d4SZ tC6cKIAJFH5He4J33G0IO94Zaxhmu/lJ3w2ke5vKSYkSVdlaPc3On12+fSTmty15DDOo P+Yw== 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-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:reply-to:message-id:subject:cc:to:from :date; bh=AJxzOEjsL6MKdtKelGgDMJsgZyeiMwUeQmM9k8YMaNA=; b=d6xk/ACPYJB6Hgdn9dWYDMaU/FIKjAnULxNrVs188xwmWiDNVvyIGDbQwt9ckpNq9H TMwHeKP04IW+vFOD3pCEdrd/IvBX5q6M57AtqHcwpbBoHFdv5Y/LcD9K3r0vgy+cin6w dCAI91jPIV/hW9hAG6OV6MQQyCM1uf98rsK2Nx/lp4HIatw3tSaGoMZOln/LvhfwGRJ9 KiJ0luTXGCChiLfvCa0JXoIgHDwmU69x+cQjgaUbBdS9wOeislWb7xswRZPngjZXukeO kGtK6JaHu2D9SAAywT+wLzYsOXZiOKtubSKMn33FKbVScGY2aTNZZdJ0lL8nRK+jqAJM 3IuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si812324ejk.387.2019.09.17.03.42.58; Tue, 17 Sep 2019 03:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727166AbfIQKME (ORCPT + 99 others); Tue, 17 Sep 2019 06:12:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:35216 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726250AbfIQKME (ORCPT ); Tue, 17 Sep 2019 06:12:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DBCD8AD88; Tue, 17 Sep 2019 10:12:02 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 5E3E3DA889; Tue, 17 Sep 2019 12:12:23 +0200 (CEST) Date: Tue, 17 Sep 2019 12:12:23 +0200 From: David Sterba To: Austin Kim Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: fix Wmaybe-uninitialized warning Message-ID: <20190917101223.GQ2850@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Austin Kim , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190903033019.GA149622@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190903033019.GA149622@LGEARND20B15> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 12:30:19PM +0900, Austin Kim wrote: > gcc throws warning message as below: What version of gcc reports that? 9.2.1 does not. > ‘clone_src_i_size’ may be used uninitialized in this function > [-Wmaybe-uninitialized] > #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) > ^ > fs/btrfs/send.c:5088:6: note: ‘clone_src_i_size’ was declared here > u64 clone_src_i_size; > ^ > The clone_src_i_size is only used as call-by-reference > in a call to get_inode_info(). The reference is passed to a static function, so the compiler has enough information to determine if it's unused. By inspection I don't see a problem with the uninitalized variable: if __get_inode_info succeeds, there's a valid value, in error case it's not used at all.