Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp212494ybh; Fri, 6 Mar 2020 19:53:09 -0800 (PST) X-Google-Smtp-Source: ADFU+vub+0xcAir/Yt7eiarNj51EEeiGUiwaULBbV+nv82W6mDvCTnUDV4TLOy1Dr4vycQ2RUQTk X-Received: by 2002:a05:6830:103:: with SMTP id i3mr4985806otp.270.1583553189130; Fri, 06 Mar 2020 19:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583553189; cv=none; d=google.com; s=arc-20160816; b=pe0Mj5t2KqxRpoDf8zhSmaqSiKvRjpR78J9P2+y0yb7NFiwTWDP0BhzE4K8MN0i1aI 3nlJC46ssuuF2uAeEvzRzvLOBdDZTIo7bHiejvW4ug8jO3meUAnDixLOARLTR0nitfqG Zuor3GnC772ndX4/xUjer4ciLZ5Od5qeroi1eU5LwluNocpRmIeNI9Zilw6vrZD8KbOb pzNElm6YedBa93MpcDGr8tLXVaBXHuJMU6PDBAYQi9FCGSPRF45tYvHaIb6OaSIKHACX IKa07B/4vp+HqP/w3sMiUeSauTY+nZGkLh2DbpRpiDBpesvflOzeS2wBhiCvterx6oZm 5vJg== 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=pnUF7Inl6h66k7NAEQah6e1BdT05wU7yn5sKiu/0JnQ=; b=whL4yQmhn4Xz2caU5DwzqNdQkklzyYTIDLvbgXMSK5KrRPobOjUgDoJy2gS+gBOFek xAKfMFpxeJBfuW/scetloGALNlpsEBt9vkd+hpGNJdIMUqGuaTyIY0nkl7QULxQKj9yo T+3KTUgxSIZ1jzAiRPgEiLOlK1YcsqL99s1gJ1N1SuVJSxxj6ceHZSzPacV9kUagyMrH SdmnP7l5tScAv0ehoxHhT4kNNTWLE4Jhj+zLziNrETGERuAOrVP06D3UEWsvybV2AhaF pE3hbR47tECCboEuPRLm0NB0ON5oxkR+LXBUzRcSccwppe+l+YYwMCL98nhfqefiRsf/ udww== 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 u6si2802924otg.73.2020.03.06.19.52.57; Fri, 06 Mar 2020 19:53:09 -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 S1727201AbgCGDwi (ORCPT + 99 others); Fri, 6 Mar 2020 22:52:38 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11606 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726382AbgCGDwe (ORCPT ); Fri, 6 Mar 2020 22:52:34 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1D32B87EBF5CB4F6D62E; Sat, 7 Mar 2020 11:52:29 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Sat, 7 Mar 2020 11:52:21 +0800 From: Huazhong Tan To: CC: , , , , , , Yufeng Mo , Huazhong Tan Subject: [PATCH V2 net-next 9/9] net: hns3: delete unnecessary logs after kzalloc fails Date: Sat, 7 Mar 2020 11:42:50 +0800 Message-ID: <1583552570-51203-10-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583552570-51203-1-git-send-email-tanhuazhong@huawei.com> References: <1583552570-51203-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 07b30f9..1722828 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