Received: by 10.223.176.5 with SMTP id f5csp413680wra; Wed, 7 Feb 2018 01:13:25 -0800 (PST) X-Google-Smtp-Source: AH8x225mfwAIDhaFCtl2w/ZJ/nH9eheHrqsVYArs3SztLFziBuZgqhnnCRbH3wkuLJc0twe7PGUB X-Received: by 10.99.127.78 with SMTP id p14mr4380911pgn.346.1517994805663; Wed, 07 Feb 2018 01:13:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517994805; cv=none; d=google.com; s=arc-20160816; b=0/BI40TbgHKC+Urca+UlqQRofeJ7jOP2JNlFWZyQ9K+4fltYRYPiqosuyoTY4UHrPv 1gs6Yd7WCtQljR4NMaiskmsbkuwhhgqGORGqOH3+jrApxjSuJzJr6KKmq2D40X93yJLA aTO5MCo7OhcfPUz93i8VjfIgHxwaU3sTx0piKMP+nLZP/zIliJE4TQPaQyWcouSXd92x seWRkzm49H8CPbNv9p4Ww/0Uqw24so6PtbG9gH5ajuXt1iK3BgTsfqH40yiqJ8R0MexW ngB8v/SanIVe2FuCDsFi3Zen9HPUpMnqwNCNT3gocp7rKodIgOqt6HQi3mUne1nH6vGE /GxA== 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 :message-id:date:subject:cc:to:from:arc-authentication-results; bh=bA8X2N1nPbAC5yJvUaqhRYlia2SyOZYZSWTd3KfWXv4=; b=Mpj8SN30f02N8I46KBqEL1BDEj/8B48P4UG3e/J8qReoJCnzRbh3/BPcaTxW/6Nr+E M7Dz/Tc7FuFkQyXFdpQuTuTTY/5m04RrHxEQwqVKQXaRwLoyYgcPJgVSpefUqUTcDJiz 4ci+spCHjdHbruPDbyAcCm5yDQEdx/DW1fYicTzyINXkQrY0RaSKeV72Dhr5odM+FB6n lGoeXYkN4zgx0/sr1i14jfouPR1kY5klShzPFrh0voULrtUdHj7OMbESqGdPg+D1Dkbx Sw43l7bzxJp1cSktyxwSJ2g7ta1YL9GHoeFr8XImPh2pl1BjoOOB0cPyJDqzctDQAqbp pZvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 v10si700540pgf.214.2018.02.07.01.13.11; Wed, 07 Feb 2018 01:13:25 -0800 (PST) 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; 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 S932093AbeBGJMK (ORCPT + 99 others); Wed, 7 Feb 2018 04:12:10 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:49106 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753469AbeBGJMH (ORCPT ); Wed, 7 Feb 2018 04:12:07 -0500 Received: from ayla.of.borg ([84.194.111.163]) by albert.telenet-ops.be with bizsmtp id 7lC51x02Q3XaVaC06lC5BQ; Wed, 07 Feb 2018 10:12:06 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ejLlt-0002Hk-Mb; Wed, 07 Feb 2018 10:12:05 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ejLlt-0001YL-HR; Wed, 07 Feb 2018 10:12:05 +0100 From: Geert Uytterhoeven To: Andy Shevchenko , Darren Hart , Vadim Pasternak Cc: Arnd Bergmann , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] platform/mellanox: mlxreg-hotplug: Fix uninitialized variable Date: Wed, 7 Feb 2018 10:12:04 +0100 Message-Id: <1517994724-5931-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 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 With gcc-4.1.2: drivers/platform/mellanox/mlxreg-hotplug.c: In function ‘mlxreg_hotplug_health_work_helper’: drivers/platform/mellanox/mlxreg-hotplug.c:347: warning: ‘ret’ is used uninitialized in this function Indeed, if mlxreg_core_item.count is zero, ret is used uninitialized. While this is unlikely to happen (it is set to ARRAY_SIZE(...) in x86 board files), this is done in another source file, so fix this by preinitializing ret to zero. Fixes: c6acad68eb2dbffd ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface") Signed-off-by: Geert Uytterhoeven --- drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 0dfa1ca0d05b0217..313cf8ad77bf68ce 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -300,7 +300,7 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv, { struct mlxreg_core_data *data = item->data; u32 regval; - int i, ret; + int i, ret = 0; for (i = 0; i < item->count; i++, data++) { /* Mask event. */ -- 2.7.4