From patchwork Mon Feb 22 21:53:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8383871 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 07BF99F372 for ; Mon, 22 Feb 2016 21:55:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 299E1205C2 for ; Mon, 22 Feb 2016 21:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44333205BE for ; Mon, 22 Feb 2016 21:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755497AbcBVVyG (ORCPT ); Mon, 22 Feb 2016 16:54:06 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:61994 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755460AbcBVVyE (ORCPT ); Mon, 22 Feb 2016 16:54:04 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MgwCW-1aKrNZ2cNs-00M4Ql; Mon, 22 Feb 2016 22:53:29 +0100 From: Arnd Bergmann To: Chris Mason , Josef Bacik , David Sterba Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: avoid uninitialized variable warning Date: Mon, 22 Feb 2016 22:53:20 +0100 Message-Id: <1456178006-1619105-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:2JSkbSqOLkDWfvhce4tYzwdCPe+awQeuvVt1GKJLiDZxnKLwM/P 9oR1WHv184Z8vsPtKokXheDQkjbrk+crMr1QvtjKCD6yoa4ELfWrMAreR2l36a8mrazY5ZQ /2Eo6ITzoZ2UokPnC8H+YM20y54HxMTCeILLZiZ9Y7g6tAlKfpgzyxd8dSyCKi7rR4WTXO8 HLN3T2TB6e9AhIVXQ9QPQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:P9ThYHGAnb0=:MKhXQ3Vsh1aCrbrDgmkbJJ iV+jdQKSmztlhd5oPdb+vAksmwbOU70KCTqnlduiRuhkxUDEt6UL3NlSRG0Wvmt9cCQxqaYtH JIq9xJzB9szVjARqPgGO6naJGbpnInAurTg7ZX8yCGhJO6+CU/Y2kPkNfaDaF2v7Qjfy3A+iA RvXdZ7FLbcBZAtDZuStPyWKBvD9JqdLnZ0ZLBI3SpPNhJysXHGKBv/KyOq/d3xSxA0A8/darx BdmqnpnjpvD+h22yMtZySbhP2Iu5QcYpRTSCRnQi7CyhoZ3KEf7zt0QW1qr7IwaZIEGp8Ln3B lRFcAH9NQRQEj6qHaXtl2bcuSEU3yh5hTd+/cBIEdUKrTKcdwWSpt8QawJxO31S025ylo/Zvw XZnOfcRHR9UUV/zot4QKXoKdfM3u10/IZKecQdOWH9iPRLFpo716NTTAoIsOT3X6FrsfnN0f5 uykYdT7tigoqEvvXraFhxe4+EdLC2ZvyS+HCojcegmvtUcZmNZyjGXDz7sN0m3Nd88KuWHjNZ UarTZYnyTnn3AuYKCnbbqo/vpEfO5jJftqEvKlG7FZfHcNJ2Tl1tt1hhBDlJZ0XMEiWA4SsNz 8FogcR6cbcaZpmTbeVgb2/AtmdojryM0mWFTHHjJRTXlFX3odDjDO4mCxu72n2+VGBgOdsrVq moz+nyJ79dBOSioeZxYZ6B0WIP6CskSuCFh6J9ioe2o9PTh6wgz1iFp+xQ7sgVJmlj7Q= Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With CONFIG_SMP and CONFIG_PREEMPT both disabled, gcc decides to partially inline the get_state_failrec() function but cannot figure out that means the failrec pointer is always valid if the function returns success, which causes a harmless warning: fs/btrfs/extent_io.c: In function 'clean_io_failure': fs/btrfs/extent_io.c:2131:4: error: 'failrec' may be used uninitialized in this function [-Werror=maybe-uninitialized] This marks get_state_failrec() and set_state_failrec() both as 'noinline', which avoids the warning in all cases for me, and seems less ugly than adding a fake initialization. Signed-off-by: Arnd Bergmann Fixes: 47dc196ae719 ("btrfs: use proper type for failrec in extent_state") --- fs/btrfs/extent_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 27577f1b10dc..76a0c8597d98 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1842,7 +1842,7 @@ out: * set the private field for a given byte offset in the tree. If there isn't * an extent_state there already, this does nothing. */ -static int set_state_failrec(struct extent_io_tree *tree, u64 start, +static noinline int set_state_failrec(struct extent_io_tree *tree, u64 start, struct io_failure_record *failrec) { struct rb_node *node; @@ -1870,7 +1870,7 @@ out: return ret; } -static int get_state_failrec(struct extent_io_tree *tree, u64 start, +static noinline int get_state_failrec(struct extent_io_tree *tree, u64 start, struct io_failure_record **failrec) { struct rb_node *node;