From patchwork Wed Oct 24 14:32:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 149500 Delivered-To: patch@linaro.org Received: by 2002:aa7:da17:0:0:0:0:0 with SMTP id r23-v6csp701528eds; Wed, 24 Oct 2018 07:33:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5fQAGQZXrzj3BoqxQnUiQDsTWlTh0vI+aELX7GRR3ajy8XjspaL+T+1aTydHrRfKBRAg3TK X-Received: by 2002:a63:ca46:: with SMTP id o6-v6mr2808280pgi.258.1540391621970; Wed, 24 Oct 2018 07:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540391621; cv=none; d=google.com; s=arc-20160816; b=lwXc4eELLAX2eh6WYxI4/QU+vjR1MzYmyPCdeNRVEKfxHN9bF3k0lniIAPFCVy51MT T5jiSaa36ABVNPJbufhCcFG6xfa8KJvXi7lGZVol2tKGtV5/dBAz/jYbZXwVEfTN0HcF gXiVc7ml2AMoYNKPDoM/UyPUng6p/S/KHnke94axJEihJKAZDP0xtkEFcJGsK9K0vqVh uCYBrbnSwBJrY8/zrJezEL1f/WGYuKf9jOctlAri4Hrn8m2pTiLfa+XyWoJ+Y6QPzAZh wP8XCW9HqxiQ84mGuudQn7FyiL+7GH83e4nIMH60etFT+ETJkdepMj4FsabRKXPgVDqY UISA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=VLDkSgmZvwZUfakAm38tkjsPQeQP8kmZ6nGE2z0mSRY=; b=cKmiCYuFEJI4Pt1JjPpYnlUCGe796ZhiyE1S5rBb/lrL4tsDhwvAMMBCUImruefMZk B1uAMQKf7LeutioBStlmJb/arfUOg0TuriXGQAW92mIBB3uMeEzuCvE+KRTU1hYqjZn1 wMRF8hUQEnD7qGXx69wU1jO0GG6dxTEf5teztugdt1shvg/VWnmdmPtwUJKET4dz6sn4 mYsCQa5CUL5GULcVKdmD5sOqcx//lee6oGp2jtZd1f+UjqRG461uCKeb2t9rrrlOJ7vb vTYu4VeCWzuWiYON4IcDymnaHfU/V6Ub4f0DU+IRSWsUxwwf/4IPT05NYh8LfDe3OkKg Fw0w== 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 u12-v6si4881121plz.196.2018.10.24.07.33.35; Wed, 24 Oct 2018 07:33:41 -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; 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 S1727109AbeJXXBy (ORCPT + 32 others); Wed, 24 Oct 2018 19:01:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14115 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbeJXXBy (ORCPT ); Wed, 24 Oct 2018 19:01:54 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 01584DE31AC1C; Wed, 24 Oct 2018 22:33:28 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.83.247) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Wed, 24 Oct 2018 22:33:19 +0800 From: Salil Mehta To: CC: , , , , , , , , Shiju Jose Subject: [PATCH net-next] net: hns3: Fix for warning uninitialized symbol hw_err_lst3 Date: Wed, 24 Oct 2018 15:32:18 +0100 Message-ID: <20181024143218.4204-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 X-Originating-IP: [10.47.83.247] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shiju Jose This patch fixes the smatch warning, drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c:700 hclge_log_and_clear_ppp_error() error: uninitialized symbol 'hw_err_lst3' Link: https://lkml.org/lkml/2018/10/23/430 Fixes: da2d072a9ea7 ("net: hns3: Add enable and process hw errors from PPP") Reported-by: Dan Carpenter Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c index f7e363b..dca6f23 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c @@ -859,10 +859,12 @@ static int hclge_log_and_clear_ppp_error(struct hclge_dev *hdev, u32 cmd, reset_level = HNAE3_FUNC_RESET; } - err_sts = (le32_to_cpu(desc[0].data[4]) >> 8) & 0x3; - if (err_sts) { - hclge_log_error(dev, hw_err_lst3, err_sts); - reset_level = HNAE3_FUNC_RESET; + if (cmd == HCLGE_PPP_CMD0_INT_CMD) { + err_sts = (le32_to_cpu(desc[0].data[4]) >> 8) & 0x3; + if (err_sts) { + hclge_log_error(dev, hw_err_lst3, err_sts); + reset_level = HNAE3_FUNC_RESET; + } } /* clear PPP INT */