Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp679732ima; Wed, 24 Oct 2018 07:37:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5cIQ0GhDpyX9uKnjHo5wUvUiZrmXR/XAmjQGMAxDH9nR0S2CxFwtuCi+39VnEL2pGvbfUiM X-Received: by 2002:a17:902:3204:: with SMTP id y4-v6mr2751364plb.135.1540391822570; Wed, 24 Oct 2018 07:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540391822; cv=none; d=google.com; s=arc-20160816; b=gjsEYH07kXapNvRUPP+hOtZn0kDqw2bZjl61ZMabipKth2JrBSDVo17onGWUi8b0S8 lPp0aNKP7nq83FALbIbeAMwfGjPL9JXu2+3yEGcbOFkZZ6FOHtVFi2gB0ReVtjsxf5SN y18zvRViRbOHiKF3Y5YYjbWFONug6xnegzXG3wtAzOgrM/gOzCJ6s6ZmdOHnnuEZko3l pBgVkwPR1fGB+RWH/MrFm9mEHj0WbVZLCMl0y01yRzsP6ZmanrwH8z6gdmzf87m3EI8S MMdfHDtOo/2cbFT8rVdvM2IsWqP4XbWVYd06GesrMiVtlLyoWGMUrXhy5pxHHOs69HqT CaDw== 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 e9-v6si4628716pgo.567.2018.10.24.07.36.45; Wed, 24 Oct 2018 07:37:02 -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 S1727092AbeJXXBy (ORCPT + 99 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 Content-Type: text/plain 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(-) 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 */ -- 1.9.1