Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758214AbcJYBBV (ORCPT ); Mon, 24 Oct 2016 21:01:21 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:41701 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756439AbcJYBBU (ORCPT ); Mon, 24 Oct 2016 21:01:20 -0400 To: Arnd Bergmann Cc: Jens Axboe , Shaun Tancheff , "Martin K. Petersen" , Damien Le Moal , Hannes Reinecke , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block: zoned: fix harmless maybe-uninitialized warning From: "Martin K. Petersen" Organization: Oracle Corporation References: <20161021154242.3707589-1-arnd@arndb.de> Date: Mon, 24 Oct 2016 21:00:55 -0400 In-Reply-To: <20161021154242.3707589-1-arnd@arndb.de> (Arnd Bergmann's message of "Fri, 21 Oct 2016 17:42:33 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 835 Lines: 20 >>>>> "Arnd" == Arnd Bergmann writes: Arnd> The blkdev_report_zones produces a harmless warning when Arnd> -Wmaybe-uninitialized is set, after gcc gets a little confused Arnd> about the multiple 'goto' here: Arnd> block/blk-zoned.c: In function 'blkdev_report_zones': Arnd> block/blk-zoned.c:188:13: error: 'nz' may be used uninitialized in Arnd> this function [-Werror=maybe-uninitialized] Arnd> Moving the assignment to nr_zones makes this a little simpler Arnd> while also avoiding the warning reliably. I'm removing the Arnd> extraneous initialization of 'int ret' in the same patch, as that Arnd> is semi-related and could cause an uninitialized use of that Arnd> variable to not produce a warning. Jens: Are you picking up Arnd's two fixes for the zoned code? -- Martin K. Petersen Oracle Linux Engineering