Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6356707ybf; Thu, 5 Mar 2020 19:00:27 -0800 (PST) X-Google-Smtp-Source: ADFU+vtJPNCqa8GyzYsFuAU1KhP6mH2fuIfbQKt0tHAKasbNtl851A6tF8nTKW4g2ogzXEVzD0P0 X-Received: by 2002:aca:1917:: with SMTP id l23mr1164370oii.158.1583463627709; Thu, 05 Mar 2020 19:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583463627; cv=none; d=google.com; s=arc-20160816; b=uLvb5Oq8jHHbg2RPksNzbTvmV0zlXTdKs68p+/nkJ/qjO5jhTrDCCT6n2ph1t+iu71 8J0ZIYiy09e9qVwqpcSPWOPCyQDU/O/im1wOhb5lSm3mdxkL0/O7pftfUiJKLAgQGkp8 JkQsUlLmlt1che1CET3hhe3ohc8kXCUwRnb8RbYdaO+V63oadia3gQCUgQe4OMyZPFga hhSPAVVBgZxnKNeQDw22/ZIf2vtQaVjf5PCacDKYnh/0jwaufJMqBiHSHSH1n7Xk4pi7 1QZbPToohI+8jEybr5aKS9NzLxMZN5yHj78FoFmBmhJTjlCI8TE28q9BrwifKOnPGkgi EjNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=PqXo/NP9ZUfpmUdLP0j9siDTT/HGmNDTU+kHVweXkHs=; b=K8z9RjY64YGIfXs4k90HoAOqNmd5/MimsOa0m4Nl5KbVnJJy7qWWAXZ+uSSlvGzBE3 guAe3y0CBEj2Md15+IXMzeCgjtU8GKc7z+UNsbIjf7bnYKzyFkZf3IAPZNHVqaoJnw9E 0Lcecn5u0/R8EJTMzdZHaozuo12Cz/CXWidrkF26UjTqCs2NnttGKHNjm/0NIsxJioQt 3n+yHcHJAv4gb88z7rq3j8OMGzT1PDqImWEy+U3KgPolxD3P1KFeDUIX8FYcubJfb02w qHK9uO0eZPPYbahJ450rUxI9z2aya0vjePD0aHNLviKx0YKXCk477Bo/l/6i+bduiuqX 6nDw== 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 a25si530314otp.314.2020.03.05.19.00.16; Thu, 05 Mar 2020 19:00:27 -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 S1727210AbgCFC6S (ORCPT + 99 others); Thu, 5 Mar 2020 21:58:18 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38322 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727050AbgCFC6C (ORCPT ); Thu, 5 Mar 2020 21:58:02 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6A4BBCADAAF88A417D2A; Fri, 6 Mar 2020 10:57:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Mar 2020 10:57:51 +0800 From: Huazhong Tan To: CC: , , , , , , Yufeng Mo , Huazhong Tan Subject: [PATCH net-next 9/9] net: hns3: delete unnecessary logs after kzalloc fails Date: Fri, 6 Mar 2020 10:57:18 +0800 Message-ID: <1583463438-60953-10-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583463438-60953-1-git-send-email-tanhuazhong@huawei.com> References: <1583463438-60953-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo Since kernel already has logs after kzalloc fails, it's unnecessary to print duplicate logs. So this patch deletes these logs. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index 8ba6985..f07d2f4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -145,10 +145,8 @@ static void hclge_dbg_dump_reg_common(struct hclge_dev *hdev, buf_len = sizeof(struct hclge_desc) * bd_num; desc_src = kzalloc(buf_len, GFP_KERNEL); - if (!desc_src) { - dev_err(&hdev->pdev->dev, "call kzalloc failed\n"); + if (!desc_src) return; - } desc = desc_src; ret = hclge_dbg_cmd_send(hdev, desc, index, bd_num, reg_msg->cmd); @@ -1082,11 +1080,8 @@ static void hclge_dbg_get_m7_stats_info(struct hclge_dev *hdev) buf_len = sizeof(struct hclge_desc) * bd_num; desc_src = kzalloc(buf_len, GFP_KERNEL); - if (!desc_src) { - dev_err(&hdev->pdev->dev, - "allocate desc for get_m7_stats failed\n"); + if (!desc_src) return; - } desc_tmp = desc_src; ret = hclge_dbg_cmd_send(hdev, desc_tmp, 0, bd_num, -- 2.7.4