From patchwork Fri May 6 18:02:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9035721 Return-Path: X-Original-To: patchwork-linux-block@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 4D1109F6CD for ; Fri, 6 May 2016 18:13:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74D24200E9 for ; Fri, 6 May 2016 18:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A39822035B for ; Fri, 6 May 2016 18:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932306AbcEFSM7 (ORCPT ); Fri, 6 May 2016 14:12:59 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37024 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758040AbcEFSDf (ORCPT ); Fri, 6 May 2016 14:03:35 -0400 Received: by mail-wm0-f43.google.com with SMTP id a17so89979928wme.0 for ; Fri, 06 May 2016 11:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y+nn+So3slyPIH60/zmF4OYhFvDBjILTZmeWzm1XVpY=; b=JAA5JxXC+VD46u8ejx60205Ol4H0mTV3V/xpdq5MhwhlmX7zQXrJ4t0gTBNCjTeTSc D+fBdt9sUu14qeZJWsAw3mVrIN6pSUSHxXxlCp+66tMh/omXNNy8KlmdhHkNi+R4b4ja oap/oINcI1FlbDKEF2Lad8FcgZN2EntesmmDE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y+nn+So3slyPIH60/zmF4OYhFvDBjILTZmeWzm1XVpY=; b=iGz/seEvan5ZyIvJtjjZTHmT9utl9zXgfW+PBBfMkNnQR0PB8F63cYg1L3Yytbsi2o etdeyrvagtgeWohlazAC0zsoiVpEs20XurVNvyZScyECdo5R2QVjv/nrNbpRpR2jhlGg GzvWveQv+YAAIUeqaq9nLnd/NbNC0duAYsYanASxREXim55OE1SFuQ8IgKPA7eCw5Mpr w3jY0a/xCYPltgY548JoQ5tjwZpgrhEkX+nyJHYyo7peQpMrw+pXnaddtIP0AURoURSE 7sLUiOXDXRypbprUpV3Q778in5aVX3UIjYkWCo8DZcH990+n2vvfc2FcnPZnjxtB5oTg XuaQ== X-Gm-Message-State: AOPr4FUAwFWevxrC0JLVJVWhbCmq+WgR/ph7tPalhRYdsvtMiSlDI+NrMG4IfMa70zhvnw== X-Received: by 10.28.194.69 with SMTP id s66mr11208707wmf.88.1462557814570; Fri, 06 May 2016 11:03:34 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id kz1sm16076559wjc.46.2016.05.06.11.03.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 11:03:34 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: Jeff Mahoney , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 01/28] =?UTF-8?q?lightnvm:=20fix=20"warning:=20=E2=80=98re?= =?UTF-8?q?t=E2=80=99=20may=20be=20used=20uninitialized"?= Date: Fri, 6 May 2016 20:02:54 +0200 Message-Id: <1462557801-24974-2-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462557801-24974-1-git-send-email-m@bjorling.me> References: <1462557801-24974-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Jeff Mahoney This fixes the following warnings: drivers/lightnvm/sysblk.c:125:9: warning: ‘ret’ may be used uninitialized in this function drivers/lightnvm/sysblk.c:275:15: warning: ‘ret’ may be used uninitialized in this function In both cases, ret is only set from within a loop that may not be entered. Signed-off-by: Jeff Mahoney Reviewed-by: Johannes Thumshirn Signed-off-by: Matias Bjørling --- drivers/lightnvm/sysblk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/sysblk.c b/drivers/lightnvm/sysblk.c index 321de1f..b1e1404 100644 --- a/drivers/lightnvm/sysblk.c +++ b/drivers/lightnvm/sysblk.c @@ -122,7 +122,7 @@ static int nvm_get_all_sysblks(struct nvm_dev *dev, struct sysblk_scan *s, struct ppa_addr *ppas, nvm_bb_update_fn *fn) { struct ppa_addr dppa; - int i, ret; + int i, ret = 0; s->nr_ppas = 0; @@ -272,7 +272,7 @@ static int nvm_write_and_verify(struct nvm_dev *dev, struct nvm_sb_info *info, { struct nvm_system_block nvmsb; void *buf; - int i, sect, ret, bufsz; + int i, sect, ret = 0, bufsz; struct ppa_addr *ppas; nvm_cpu_to_sysblk(&nvmsb, info);