Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4778740imu; Tue, 29 Jan 2019 07:22:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7SrNCwHnyQ5XVQ2PYDnt2L/I3WFB37Aw2ReBv+QkbKfInn3oDjMdzjGqwcqWO/Tym47K+R X-Received: by 2002:a17:902:5a0b:: with SMTP id q11mr26655682pli.186.1548775358520; Tue, 29 Jan 2019 07:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548775358; cv=none; d=google.com; s=arc-20160816; b=VMQEr39dFye4Qbh3Ffd1eeH2dy7bkSda4tf2YE6sOSQQmhQ3lMeya6BYaNJy0sVAI0 fb4zIAEvurH+us8dJZuPj6WfbNsTBySGa38Ci0rZ4nrGF5HybYtyFV6xIIj92Cop2UEI 9MfyTy1VZxzqQom1vJ1zlXh6bFTQtgtl/vDLCztCDqI0XFRiBapkkilVA084KNoJUcXI 3ifGMQlk8me0PkPPqRf/UKGsoTsF2Xc3/qHzNg1MkjFOQWiXGGfgfKimrQgxlXqJlr3l hYQd8ruJcORi6TmDMCUr4pdFtQsvlUc84zExpJBEg85Vp0zv2hh3ToibOusYfYn+4tTV uYqw== 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=SYyFKisF2XYHKyNy6OeUG5kyvvqBYqqMlLNbOV19TCM=; b=g3+hZWgQo7Ovnuuh4MNNWfWuWPcpSu672l8nC6cJ8k+vE6t36islUZP/xiMTrButI/ JmtpkB6dpr3pD081YyaHinV2gKHoIqvBPHjkwhJZInS/6IYkcnr1N1TSXwe0PR+Jcvsl 9Q2Ly8R1NsOnRWFAPpzNkjuFnq90OauwyYkd1K67xmd2c2jY459kYmWo9Y01u2A+Mulc pBgcc1IxDYj42oTnsOTAblMR/DlSzoRad85odDVvMu6CH+FnyW+bsIcteNWL3H6GI7aX 3Q/SIVtnzq6XNV3xwp76L6pxu/oIeVM/w4dUdnt12/89P4ipIPkmB0eOM0mp6l3JIWRv m0cg== 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 c10si36119316pll.271.2019.01.29.07.22.22; Tue, 29 Jan 2019 07:22:38 -0800 (PST) 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 S1728164AbfA2PWH (ORCPT + 99 others); Tue, 29 Jan 2019 10:22:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:55022 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725730AbfA2PWG (ORCPT ); Tue, 29 Jan 2019 10:22:06 -0500 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 9C706B0EF; Tue, 29 Jan 2019 15:22:05 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 622E7DA78C; Tue, 29 Jan 2019 16:21:28 +0100 (CET) Date: Tue, 29 Jan 2019 16:21:27 +0100 From: David Sterba To: Anders Roxell Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: relocation: fix unused variable Message-ID: <20190129152127.GN2900@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Anders Roxell , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190129130146.11934-1-anders.roxell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190129130146.11934-1-anders.roxell@linaro.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 02:01:46PM +0100, Anders Roxell wrote: > When CONFIG_BRTFS_ASSERT isn't enabled, variable root_objectid isn't used. > > fs/btrfs/relocation.c: In function ‘insert_dirty_subv’: > fs/btrfs/relocation.c:2138:6: warning: unused variable ‘root_objectid’ [-Wunused-variable] > u64 root_objectid = root->root_key.objectid; > ^~~~~~~~~~~~~ > > Reworked by adding a runtime check in the assfail function instead of > the '#ifdef CONFIG_BTRFS_ASSERT #else ...", so the compiler sees the > condition being passed into an inline function after preprocessing. I've fixed the warning by avoiding the local variable but I like your fix in general, thanks.