From patchwork Mon Oct 17 22:10:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9380737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3334060487 for ; Mon, 17 Oct 2016 22:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09BC928CF6 for ; Mon, 17 Oct 2016 22:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F298B28D01; Mon, 17 Oct 2016 22:11:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CA2C28CF6 for ; Mon, 17 Oct 2016 22:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757819AbcJQWLV (ORCPT ); Mon, 17 Oct 2016 18:11:21 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55549 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757746AbcJQWLT (ORCPT ); Mon, 17 Oct 2016 18:11:19 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MbGQ7-1cGG512yh1-00KibQ; Tue, 18 Oct 2016 00:11:08 +0200 From: Arnd Bergmann To: Ilya Dryomov , Sage Weil Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Arnd Bergmann , Alex Elder , Mike Christie , ceph-devel@vger.kernel.org Subject: [PATCH 11/28] block: rdb: false-postive gcc-4.9 -Wmaybe-uninitialized Date: Tue, 18 Oct 2016 00:10:14 +0200 Message-Id: <20161017221037.1781185-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161017220342.1627073-1-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:xT5Agvg/kmBiAgDPHWvtEwGfUAK4FX4TpfIytJKM9MZB/B+rbvB j2BCIwuLbT2RJTVKTWCZt5HmX/1WXeCVgF1uSdExjCfwRVnoo6TmaIFa7N3+noQ3WjbzZeo w4v/Prt4fKs4B+OG1f4n22qvfDylPztM2C9sQfibxk61ySzKw67KZTo9mKRVkZ+Un9nOK5u 2YIw9LBgLQQ/qM3UYvMxA== X-UI-Out-Filterresults: notjunk:1; V01:K0:L5blqrQcNj4=:l4mVWZF5kNRXFxA99QE56Z Va/qVkJP4eLCG4LIL8CwA1EFsAh5rq2zNvYgKXF0CSg9Hgx6nEgFONwtVfFNV5kF4WZbJDsIs gPs6mGAsH/679mm9XjWHkzrHuuc03s7gksjUismlMrAUl6g+1E+hCixzF8cRVr2rALPY8vkr3 K6YsPV2LAENXaeSzypMFHHgaPq8PZjQj2dXRfJfaQn9mum6rf1Z7iFWpb1Xy0qNUm8Ut/9eRA auhhYWDOpkggTvB4JmDg1ArrD21jyH0LTklmDXUY2yi/eNPZliXi+YlXI/iz8SI1/Y+CdaP3g wSD2A0uNSDsI2pX5lj6wPPrPnia/HcoX2sFMfpauPJVUeV/7nZ6lZMeBQQKKrexv+30tlvzye AhFSNGCK2CAwqm2Z7JJOR+0QfgEgRSzryiKzUkg7K7Sg9dW+8wIEJcP2dsU+ik3/BkqyZ/GIm Uey4VJ+DwQ3vTKT0XaxeJRQ3ewr1pTh5ZofQH4fI5fb3vdZ06irCyU2E17FsyNjRGmNMGrxHi aKWrYU/NL6FI4xi1VilDPEqma15N6u0GvCDsP4fChNUBcKqXiW7rjszEesLIyjgJmTmXofAQK P9n0RPIUgadwQp5EwAtQdXhW2FriKTJJHgsNs7JUOK8nMUD8r5p8FAIAfbgzYBkqCZm/w4Sed n3eNzoXSD9mhWThxNHWwUYvgjui6KBmhXHjYztzTXtyql68G5Lj13Y3OCv/XhiwdK6fcpikoW +IzFLmPKZE6aQ6RX Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building with gcc-4.9 -Wmaybe-uninitialized, we get a bogus warning in rbd_watch_cb, as the variable is not used at all in the one case in which it is not initialized first: drivers/block/rbd.c: In function ‘rbd_watch_cb’: drivers/block/rbd.c:3690:5: error: ‘struct_v’ may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/block/rbd.c:3759:5: note: ‘struct_v’ was declared here Later compiler versions fix this, but adding another initialization here is harmless and lets us build cleanly with 4.9 as well. Signed-off-by: Arnd Bergmann --- drivers/block/rbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index abb7162..4ab990b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3776,6 +3776,7 @@ static void rbd_watch_cb(void *arg, u64 notify_id, u64 cookie, } else { /* legacy notification for header updates */ notify_op = RBD_NOTIFY_OP_HEADER_UPDATE; + struct_v = 0; len = 0; }