Received: by 10.223.185.116 with SMTP id b49csp3942217wrg; Mon, 26 Feb 2018 08:34:25 -0800 (PST) X-Google-Smtp-Source: AH8x2263/75hH93/ykmIpHIru1vT2TBke1xYk0M9PtAhCofU0bwuu042W9SW5SRBJsfH6h8RsBce X-Received: by 10.98.13.196 with SMTP id 65mr11087817pfn.139.1519662865738; Mon, 26 Feb 2018 08:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519662865; cv=none; d=google.com; s=arc-20160816; b=vAbmCr1vwnAvwtcPiEdBxkHGEDc/S46XexwPW9bbAWxBeRnTkbTSNrfiwEuM8SOpt1 gWDQ2zSsl2K8uCCuu/ExrpU7AebLTbg+lNCVc8i8xH8WORzj3V6awhYSQNDqgw6hl8fm BQUaUiH3lBrhuwGaj0ftVxG1QygndGbmLlKalECaJiig7Yi7A1E1EKWLQ5BSq3Xy6Sso gWDJLlDzJyrmRh4QNeYHEMfBbxvtLab43OC7fpIQCCl8xAL7iQHjfCia2/c6qfSzG5aw a+XuyQzq0gsey4gI1Di0PrLnx2QF0Z0yxrrQPW5QvB9ExV3T2EfbpdbFYmoG5KCJFUTZ HH1g== 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 :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=UwpsKyV+mA37x0ONXv2uDQAxZi2usx6wMqki7CI5lv8=; b=QFdLhs7wUFstZC19onfEBUF2+muHIvnsbDveGdHwDENY5vJCFHJu+dlfkzfmdH0CMo h6qC1F9/iaLhkSbsBFrbHi4PbAXHdNLKUu7VROj2QLCOHJqGTYlBxpJtxLgMAN3lW+W1 kx71ndTYRNNJbhA86Go7jjGI1JfK0rxbiU9Rz8ncfw77vTx/otgvsFhaLcUJdg4ZqC4y 4SaDgp9NbHkoWnKtbH1SBrHsD5Rpw09vIR7Hfr1wkjk0z9Dlehn/DrlF6XpEQnFXh19S EYAVcfufxKFEsoKAevPviKdxIskM3+0m4qCRp3uedMJq0Frs/+adGV96A99AvUit+0eS 6kxQ== 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 q16si6881824pfh.395.2018.02.26.08.34.10; Mon, 26 Feb 2018 08:34: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 S1752200AbeBZQdd (ORCPT + 99 others); Mon, 26 Feb 2018 11:33:33 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:43866 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbeBZQda (ORCPT ); Mon, 26 Feb 2018 11:33:30 -0500 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B7C32141EF2DB; Mon, 26 Feb 2018 08:33:29 -0800 (PST) Date: Mon, 26 Feb 2018 11:33:29 -0500 (EST) Message-Id: <20180226.113329.1873010713546052461.davem@davemloft.net> To: arnd@arndb.de Cc: arkadis@mellanox.com, jiri@mellanox.com, idosch@mellanox.com, weiyongjun1@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH 2/2] mlxsw: spectrum_kvdl: avoid uninitialized variable warning From: David Miller In-Reply-To: <20180223131540.1065413-2-arnd@arndb.de> References: <20180223131540.1065413-1-arnd@arndb.de> <20180223131540.1065413-2-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 26 Feb 2018 08:33:30 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Fri, 23 Feb 2018 14:15:32 +0100 > gcc warns that 'resource_id' is not initialized if we don't come though > any of the three 'case' statements before: > > drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c: In function 'mlxsw_sp_kvdl_part_init': > drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c:275:8: error: 'resource_id' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > In the current code, that won't happen, but it's more robust to explicitly > handle this by returning a failure from mlxsw_sp_kvdl_part_init. > > Fixes: 887839e6960d ("mlxsw: spectrum_kvdl: Add support for dynamic partition set") > Signed-off-by: Arnd Bergmann Applied.