Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757366AbcJYCvn (ORCPT ); Mon, 24 Oct 2016 22:51:43 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:35478 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbcJYCvk (ORCPT ); Mon, 24 Oct 2016 22:51:40 -0400 Subject: Re: [PATCH] block: zoned: fix harmless maybe-uninitialized warning To: "Martin K. Petersen" , Arnd Bergmann References: <20161021154242.3707589-1-arnd@arndb.de> Cc: Shaun Tancheff , Damien Le Moal , Hannes Reinecke , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org From: Jens Axboe Message-ID: <804d9f6b-22fa-ded3-301e-b7b3643c72d8@kernel.dk> Date: Mon, 24 Oct 2016 20:51:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 23 On 10/24/2016 07:00 PM, Martin K. Petersen wrote: >>>>>> "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? Yep, adding them now. Thanks Arnd. -- Jens Axboe