From patchwork Fri Sep 21 15:41:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147293 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp970938ljw; Fri, 21 Sep 2018 08:43:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY2xm40SFb+Qr36rlRtzgFpZCIE6qTJ7NdEHqmbrWG0YEmxrwLd/bizbn1pOasd1YLLxrIh X-Received: by 2002:a63:9752:: with SMTP id d18-v6mr40173023pgo.405.1537544593535; Fri, 21 Sep 2018 08:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544593; cv=none; d=google.com; s=arc-20160816; b=hbDZ+swe5hwCvlWWlJBqWcDhR22mUDa4D7EkaVQfO1zeWmjgsXKBt5d4akUGVIBEBS BTEQpJ3M4hHMnC+OfkPGYjW/huLsXVjlV2v15y1/Zr52caa2Zpro6KPBQm5a2z/f6npH uxNcwAjCBmTf0s/0L5A1f7/cpPQgIyl4YCJYecwZlUJAQi5IbJGUjkOP3eILmVwVDCNf yWHnuxBQhWKDphRFD/koKTgyjIJOtMbJLfqvEv5qf07HpIkYTrp2p0oxJaYE09nnHIO0 doG8oBCijnKTVZF8X3sY1RFiQ26lvXLyRUomxttVlts3kEtXLJf3H8CpirhI1EnGrVEc 5Vvw== 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=SfCGHVefqYxOoTsYnCK4kU9IBbuaR1nF9OOFt03YhvY=; b=YQs0dR1x6YwNm2r+cjDAGWtuwm0zT2iGGfxYNQVugajQViDwQsK4aWBah33Y3lHUuQ V7Hj3YPDin1sGuFaJUaD1xQCWX0RQRJM0TKmejS4mclkliJsXpRH6FwwyOb9aUQWhHGo Rl4MUqWRqsM+c8vYbstZVpvABQlYsRXTHDe7fYNGx4hH22qkIzu33y4dBGNMRtf1/G92 HbL/klKf//SLHJ62FGpt+kaNH2lDnxL3C5Cu78dWDN2Js24dPULLm9fbRCCN6PuTX1rM GMCHkrHDem3RNQpYnd9hcudQirBwKbfit3p2u8DJhp0iER1XhhVK6+dO8HWEIplZ4//O 8u1w== 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 f2-v6si26951528plo.206.2018.09.21.08.43.13; Fri, 21 Sep 2018 08:43:13 -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 S2390705AbeIUVch (ORCPT + 32 others); Fri, 21 Sep 2018 17:32:37 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43033 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390679AbeIUVch (ORCPT ); Fri, 21 Sep 2018 17:32:37 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1876832FC98B5; Fri, 21 Sep 2018 23:43:08 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 23:43:02 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 08/12] net: hns3: Add unlikely for dma_mapping_error check Date: Fri, 21 Sep 2018 16:41:44 +0100 Message-ID: <20180921154148.26756-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180921154148.26756-1-salil.mehta@huawei.com> References: <20180921154148.26756-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen For dma_mapping_error is unlikely happened, this patch adds unlikely for dma_mapping_error check. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 73b42d3..8b63707 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1807,7 +1807,7 @@ static int hns3_map_buffer(struct hns3_enet_ring *ring, struct hns3_desc_cb *cb) cb->dma = dma_map_page(ring_to_dev(ring), cb->priv, 0, cb->length, ring_to_dma_dir(ring)); - if (dma_mapping_error(ring_to_dev(ring), cb->dma)) + if (unlikely(dma_mapping_error(ring_to_dev(ring), cb->dma))) return -EIO; return 0;