Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2153imm; Fri, 21 Sep 2018 08:44:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamVE6/wM4LbUs8SVulLG7Wdz1uIr7yLC1dWwuZ62btAzOZjdHoXzf7KlkHUoC3D/mVNd2u X-Received: by 2002:a65:40cd:: with SMTP id u13-v6mr41602624pgp.334.1537544689099; Fri, 21 Sep 2018 08:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544689; cv=none; d=google.com; s=arc-20160816; b=bRv/rp6BxgnEeSohw9B4Yqlqf55JFkhiO5iEwGdCdhRvLnJIkfe4FkaSqLBChp+WXW S50oNkQhF+Cmjfe5iTN/0GcJ8DU7LXf4vdGOJQO0FmK9dBH2aHxSIOJJlFlIvpkT3PsQ 1EniZaeD0YCqtrcponfenbLpgI6IW1Zz1sAWAQ8+Sz2FVlyitJyoC2Ii8GT1n/TWS7JS Hgc86DyB9AKrvzPQuni8CPHhUYI18vaglUBpeiW3OW3rgXqP0Zzf0X4pEoozF58zKABp s4g6tu2cluK0klzZtTFYl7sRYaE85mb8/hRaPHCrVFDQNya2qD19HtwPhaxakNTvZrUw kNqQ== 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 w21-v6si26441585pgk.206.2018.09.21.08.44.28; Fri, 21 Sep 2018 08:44:49 -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 S2390700AbeIUVch (ORCPT + 99 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 Content-Type: text/plain 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(-) 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; -- 2.7.4