Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4452933rdh; Wed, 29 Nov 2023 01:48:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkBGIR262vRl9LDUgXcJe31juhq7IGglZUo97qZLKFGSeiYvR6FxQrsFJA5WGrRbHoW4V2 X-Received: by 2002:a05:6a20:144e:b0:18a:d766:cae1 with SMTP id a14-20020a056a20144e00b0018ad766cae1mr15846336pzi.54.1701251324941; Wed, 29 Nov 2023 01:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701251324; cv=none; d=google.com; s=arc-20160816; b=mHL+XRexCjZB8IrKVEX8F5qqRpKFdCG3MShdS/5OaRhbWE+hWbiF4u4/pYSpCsYh6m y9hCNPHN9ls8Wba+qyS8A9KKDhv1aogF96kqapcNdQ8jYWpq+5ZuClJIcgUI4tgmFNOn Fd71ClGZFfOTMgEt2eS1H5v8tejeuCsz/C8o8xtvstvan1uIAfyLSDGAikGHD049vWg3 BsWyUWy2tZVFaBPYoXgSC18cWszbYexSZrhMv5nt05eFMqi5MwcQfYPiIvtaYqDUq4WA d4M+pI9Sjq2LxRKZQIdhaJPTJO7uitYEUXJjDOU6NnB8bNNRCnJY197IuPB1TRTzO8HK aG7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=UKN523bBpFfhqNntK4E+t7LG85lba0F7vKfTvsWv+V8=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=K+XBJTSQHYTFrahqBsWhYxcVJiiUVswiwCjE6AByb+IEqKaCI9A2MigFiBQ44o6KpH iyVlZOWjvJnPPq7XSx5Y+aiCNdDBkbGlZV7dTXigx2/u31pKdZP4VEpLwCmvNpktnFpC C8psQfhYotbOkqn/203NjcgB/5YS5ODXDbd8mzlE0q/02IBIu+F7nYifwvqcstew/62l 2OSWe6SvzZ+gW1ZJMBSuxWx4q6vUpBUYzytOpV3LBuZyMzaVycSS0x0OlOLqzyfpwCk+ osbrCMdOnQst/EfRp9BEsw+iGPxcsaOg2lsmJ4+qAwSdasx3jSZuPI1WLqi2ZCPsMtFQ RHwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id i8-20020a170902cf0800b001c413905d87si15251424plg.49.2023.11.29.01.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 01:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 58862805A5F0; Wed, 29 Nov 2023 01:48:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230260AbjK2JsP (ORCPT + 99 others); Wed, 29 Nov 2023 04:48:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbjK2JsF (ORCPT ); Wed, 29 Nov 2023 04:48:05 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8150219BA; Wed, 29 Nov 2023 01:48:10 -0800 (PST) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SgDy46qc4zWhsd; Wed, 29 Nov 2023 17:47:24 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 29 Nov 2023 17:48:08 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-rc 4/6] RDMA/hns: Remove unnecessary checks for NULL in mtr_alloc_bufs() Date: Wed, 29 Nov 2023 17:44:32 +0800 Message-ID: <20231129094434.134528-5-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231129094434.134528-1-huangjunxian6@hisilicon.com> References: <20231129094434.134528-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 01:48:41 -0800 (PST) From: Chengchang Tang ib_umem_get() never return NULL. Fixes: 3c873161a0d7 ("RDMA/hns: Add support for addressing when hopnum is 0") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c index 14376490ac22..e71988a6c277 100644 --- a/drivers/infiniband/hw/hns/hns_roce_mr.c +++ b/drivers/infiniband/hw/hns/hns_roce_mr.c @@ -674,7 +674,7 @@ static int mtr_alloc_bufs(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr, mtr->kmem = NULL; mtr->umem = ib_umem_get(ibdev, user_addr, total_size, buf_attr->user_access); - if (IS_ERR_OR_NULL(mtr->umem)) { + if (IS_ERR(mtr->umem)) { ibdev_err(ibdev, "failed to get umem, ret = %ld.\n", PTR_ERR(mtr->umem)); return -ENOMEM; -- 2.30.0