Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10240688ybi; Wed, 24 Jul 2019 19:06:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzV9p4x7lDZCrKU+iADJgEUryHrvrnDThE6grGBXDFfGIKeI+UcgB4EW3bSeqZPOPIwhgj/ X-Received: by 2002:a65:584f:: with SMTP id s15mr67563621pgr.175.1564020398073; Wed, 24 Jul 2019 19:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564020398; cv=none; d=google.com; s=arc-20160816; b=MjV0J6byGQ05iByzb/6CxcL7Zf5unvYefGYJXwNWtTkoaZdJXvS4QV7SyKjDI9+aZq 8UGB7uLdqF3K2cLtRX+CODzOXuQVYoFeZGfWlRIP+g92uD9MvLltK+0R9eGjHNTJI3HA 6hW7LuPFAA/bYSov7+v1M+51L63BYXy+dWcGnnyjuqdBOM8pbAE5TMVqKWtOPWctU7BB hYhnv2kq7yuQ+4DI3i3omLSBzx61azYEexNQjc1cnwq1jfo+DsWunt2TtgB+1nrbAtVD wMAgIOB4Xy8UORfDh0SvB8K2LwACx0w6FcKFGtv/QHGIypriJjrOOdoTj5CNGlA0iEBQ hEhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ek6xFFi/GBVuPhiYG2ki+rZYdLuDaBdVBObygUILJbk=; b=vKA5AOo2xxJCYV5Q+x3NrbK1sYr8/WHpKs93VPfr+3Q+K14QK7DTusxE6QHNEFOL2m zAbJoEzM5yiN2aXwjyE9OwvFG+4j7XnrK1J10ygf+UViJUGUcFI0UGmYQkNSYzvAEKr8 N1YvVqjTXuhkALCkkD4qES7MfqAeIMGcAWl8GGzi44BRT2qdFs1ANl24+EOFMWgTxIlp fpa+W7k/sKdnqO82U3az5RZwHVRyYTUFh0wIvSHfXGf15rbcF/2e5x9SU8t0JnF2yYC3 DjsaKpUrHYyLEVq5otFoW+3tioGUgumcw1haGPzjRLCKndki86VChL1UJ7DUsGxlUyom S/ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ol47cOVy; 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 q4si17200092pfg.286.2019.07.24.19.06.23; Wed, 24 Jul 2019 19:06:38 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Ol47cOVy; 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 S2389406AbfGXThJ (ORCPT + 99 others); Wed, 24 Jul 2019 15:37:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389398AbfGXThI (ORCPT ); Wed, 24 Jul 2019 15:37:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20926214AF; Wed, 24 Jul 2019 19:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997027; bh=bVoWQeAj3bCosk4IPCszsS0GH2qnu2Ait/MZtiHsA+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ol47cOVyY6p7X9y8jPGsi/IOYJKXougdWw/2ZDZzKeh1oIY0jtB61eVkmIkKLfZ/E go5HvNs7PMmJNiCESRazF/NuzEAhjfmAG8f6nzyw8Z6V0UD5UqHg3VjRMcIwQk1LnX cJXG0DkCyGhXgFTeNhxQdxE9BQa8PTWuYeXz5KSU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Damien Le Moal , "Martin K. Petersen" Subject: [PATCH 5.2 257/413] scsi: sd_zbc: Fix compilation warning Date: Wed, 24 Jul 2019 21:19:08 +0200 Message-Id: <20190724191754.404270441@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal commit 0cdc58580b37a160fac4b884266b8b7cb096f539 upstream. kbuild test robot gets the following compilation warning using gcc 7.4 cross compilation for c6x (GCC_VERSION=7.4.0 make.cross ARCH=c6x). In file included from include/asm-generic/bug.h:18:0, from arch/c6x/include/asm/bug.h:12, from include/linux/bug.h:5, from include/linux/thread_info.h:12, from include/asm-generic/current.h:5, from ./arch/c6x/include/generated/asm/current.h:1, from include/linux/sched.h:12, from include/linux/blkdev.h:5, from drivers//scsi/sd_zbc.c:11: drivers//scsi/sd_zbc.c: In function 'sd_zbc_read_zones': >> include/linux/kernel.h:62:48: warning: 'zone_blocks' may be used uninitialized in this function [-Wmaybe-uninitialized] #define __round_mask(x, y) ((__typeof__(x))((y)-1)) ^ drivers//scsi/sd_zbc.c:464:6: note: 'zone_blocks' was declared here u32 zone_blocks; ^~~~~~~~~~~ This is a false-positive report. The variable zone_blocks is always initialized in sd_zbc_check_zones() before use. It is not initialized only and only if sd_zbc_check_zones() fails. Avoid this warning by initializing the zone_blocks variable to 0. Fixes: 5f832a395859 ("scsi: sd_zbc: Fix sd_zbc_check_zones() error checks") Cc: Stable Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/sd_zbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -417,7 +417,7 @@ int sd_zbc_read_zones(struct scsi_disk * { struct gendisk *disk = sdkp->disk; unsigned int nr_zones; - u32 zone_blocks; + u32 zone_blocks = 0; int ret; if (!sd_is_zoned(sdkp))