From patchwork Thu Dec 7 11:42:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Huang X-Patchwork-Id: 175094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4721392vqy; Thu, 7 Dec 2023 03:46:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUZsbi9dGRUQ80fQa18UrAG/N7gzsh6zNxOg95Rjdz2CvTqghcyCmBQ/aHqhJ0MpJd/okk X-Received: by 2002:a05:6a00:1583:b0:6ce:2731:79f4 with SMTP id u3-20020a056a00158300b006ce273179f4mr1823377pfk.42.1701949596854; Thu, 07 Dec 2023 03:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701949596; cv=none; d=google.com; s=arc-20160816; b=GxQ917mChFCMPjvboPDhgzG3cHZb0iR1Zd8+w5lTcYVcygPhB5UQt1k4IsUJ4kEaiE 6C9G2e1BAV7hMppImh5a/CUVdBf9L79oxEUXXsN6DD4aZPzKK+2c7tFkoBre68fDuiDx wpQfEbxCuSti9ysCHrHqOXqJXyNIF3QwLS6chfBre7rV9X87OR9ki+uvBY4eV/EjAFV1 N0q2+wcFWseRnHQ4an+pmT9jaYmHjeuA/NMrUlIfL6gJ1A1lHqZk81Oq4jSPyJAoZLrE X3v+g/ObZkOcKT7hlMCGu9l3sKJXTSQO6ajV3R+XrqfUdjv1GHvA7glb1KNjYhwV9SE4 3Paw== 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=bztLFe4FuHzw/Ej9XgmkQ60/r7H9PwMUnYfTekT2Gyc=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=yQlh47PhHy1fEI7WpdX8PCqfui2LUqa/dLOaS68neL/LjryTHg7wKO1FUPF+84AO3P xATH6e4G+Fa+zbFG5YnjDIiYalSBMl2lcbfK1NzCmpgXrc7e4NfuD6ezFSsgudUOQmU4 3UPon/GJlw9GddEmuFM5UWrunVzwk/wuOD+rUqH7QF1PjwfcYT1KYn4ylNFdiXxUt3Rm heYS5R6qDAJIs0sA6nLPIP9Tqe3pfJKfO7/GBm15KNpRmOM5Uvkj3/frMZVEmyWjBDxf MDpJgXywcy94/cMXkuRWkkPeo9L3XI1GqTFrmzjCsQOLQVZvXOAcMcmUWfh7D0VBx5Wz pQmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id dn16-20020a056a00499000b006ce555313a2si1067657pfb.382.2023.12.07.03.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 03:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id EE661809A781; Thu, 7 Dec 2023 03:46:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379021AbjLGLqR (ORCPT + 99 others); Thu, 7 Dec 2023 06:46:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbjLGLqF (ORCPT ); Thu, 7 Dec 2023 06:46:05 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C870519A; Thu, 7 Dec 2023 03:46:11 -0800 (PST) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SmC711lmrz1Q64T; Thu, 7 Dec 2023 19:42:21 +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; Thu, 7 Dec 2023 19:46:09 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH v2 for-next 4/5] RDMA/hns: Remove unnecessary checks for NULL in mtr_alloc_bufs() Date: Thu, 7 Dec 2023 19:42:30 +0800 Message-ID: <20231207114231.2872104-5-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231207114231.2872104-1-huangjunxian6@hisilicon.com> References: <20231207114231.2872104-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 03:46:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784623500422542569 X-GMAIL-MSGID: 1784623500422542569 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 d68074b6ca17..91cd580480fe 100644 --- a/drivers/infiniband/hw/hns/hns_roce_mr.c +++ b/drivers/infiniband/hw/hns/hns_roce_mr.c @@ -686,7 +686,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;