From nobody Fri Apr 12 17:21:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VGNdM3ZtDz5HlZ0; Fri, 12 Apr 2024 17:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VGNdM1S4cz434V; Fri, 12 Apr 2024 17:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712942471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/ep6Wb1yXsYez7r2DK9wSMkixE77bo3pKLMco2divo=; b=iUDdcVPdwtRJU4F6PbaGk/OO4xSWo7hp99uhvVm/sFkmFQN2NMVn4p2F/RUPRB2dH4dR9I bjKrFD1zk52GNbDNIzcEl/hmbFBm0ipuXotaIXfEjHMYH1XCUk6YYnWF9KyCHw4Ek0sqdW oWEfqbyad+T3ljyZOfaYToKWzPYj83cIauRbO961twpqfFIVDZDd7CPWaZlmeES2GhxnGk ggqaQ6CItqDRPvw++Z8OHRYa7cBx8aVjd/W46Dl02tfNm1ElKDluYHMIsKuBXJ32MsE/lh MCVxxQo9ysoBu5KLI3twwI10DT4RPf3+M3kw4uOVCaz72z4LlAwVYMnKt2OLsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712942471; a=rsa-sha256; cv=none; b=aILgvPhoDkCUWlbZXv0NJPXpnOWsDiMqjsAkZBp+u8jsbhgXuPKzQEBUAZ4mN+tthghzuP wT0QFEivh79JOJciBcX6M3ITGTsX6BvJ8wC8rp0zbb/fZthrZw3fnHFZjdAq8sxKRpOqVe 6U5ZHWEc1I7YzXfvYz8JofDGPCBySXZk0Gv7sSuJwnbO6VbNG3y05mEI7+lJsE6UbMVCKJ gmW4OACh0j742o++QzitUqpBWLlRwBPgxNgUt5KxADWLRfw2PGSCsCGGvKnIyJbrGx1jrj cK+wJjxGmIqP2u0Th/IIq8ieCl6fsk9r8AMgnXEMnZ5r5FOtRMHIWwoNX+T+ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712942471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/ep6Wb1yXsYez7r2DK9wSMkixE77bo3pKLMco2divo=; b=t+4a8eSsmz0F3YLlUWXCGkozR7dKEZL36Tn42KEIq51ZhNTCcLwuYAb1liSkgzc7EeuytQ aHeKs/L9w+6vOvZs4dzs1StYLR+apsUM55LpDnCyPopyYz9bnGNFRugtmORd6g8eEdr5XP rdbO+bKRggY+TTqKwBw1UEmM/pbjywm6I1x2EBJvXeJKqwq1stJjTXvXn2kw4jZippFbKn Lb+uevJpHrHo8Em4SoyrYiTtG3NF47bv7ByEFo+6BRBSdfvonS162OFw19Ih8wZzxOXAQj SwLopL/Ao0BsdK/kOc4Mj6UdF8MqQr2PQBd/J+/lpTE/rxleO/uSPEZ6h7soPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VGNdM0ngdzy38; Fri, 12 Apr 2024 17:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43CHLBaQ086497; Fri, 12 Apr 2024 17:21:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CHLBx2086494; Fri, 12 Apr 2024 17:21:11 GMT (envelope-from git) Date: Fri, 12 Apr 2024 17:21:11 GMT Message-Id: <202404121721.43CHLBx2086494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: cb722b67796d - main - ibcore: Remove the use of NULL_IB_OBJECT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb722b67796ddc700c73919183e80049c3ec17f3 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=cb722b67796ddc700c73919183e80049c3ec17f3 commit cb722b67796ddc700c73919183e80049c3ec17f3 Author: Ka Ho Ng AuthorDate: 2024-04-12 16:57:35 +0000 Commit: Ka Ho Ng CommitDate: 2024-04-12 17:04:23 +0000 ibcore: Remove the use of NULL_IB_OBJECT LinuxKPI's XArray implementation accepts NULL as an input as of the following commit: - linuxkpi: Accept NULL as a value in linux_xarray (3102ea3b15b6) Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44533 --- sys/ofed/drivers/infiniband/core/ib_rdma_core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/ofed/drivers/infiniband/core/ib_rdma_core.c b/sys/ofed/drivers/infiniband/core/ib_rdma_core.c index d259449f698e..456c5df9a22f 100644 --- a/sys/ofed/drivers/infiniband/core/ib_rdma_core.c +++ b/sys/ofed/drivers/infiniband/core/ib_rdma_core.c @@ -293,8 +293,6 @@ static struct ib_uobject *alloc_uobj(struct uverbs_attr_bundle *attrs, return uobj; } -#define NULL_IB_UOBJECT ((struct ib_uobject *)1) - static int idr_add_uobj(struct ib_uobject *uobj) { /* @@ -302,7 +300,7 @@ static int idr_add_uobj(struct ib_uobject *uobj) * object which isn't initialized yet. We'll replace it later on with * the real object once we commit. */ - return xa_alloc(&uobj->ufile->idr, &uobj->id, NULL_IB_UOBJECT, xa_limit_32b, + return xa_alloc(&uobj->ufile->idr, &uobj->id, NULL, xa_limit_32b, GFP_KERNEL); } @@ -325,7 +323,7 @@ lookup_get_idr_uobject(const struct uverbs_api_object *obj, * kfree() could be called at any time. */ uobj = xa_load(&ufile->idr, id); - if (!uobj || uobj == NULL_IB_UOBJECT || !kref_get_unless_zero(&uobj->ref)) + if (!uobj || !kref_get_unless_zero(&uobj->ref)) uobj = ERR_PTR(-ENOENT); rcu_read_unlock(); return uobj; @@ -589,7 +587,7 @@ static void alloc_commit_idr_uobject(struct ib_uobject *uobj) * It will be put by remove_commit_idr_uobject() */ old = xa_store(&ufile->idr, uobj->id, uobj, GFP_KERNEL); - WARN_ON(old != NULL_IB_UOBJECT); + WARN_ON(old != NULL); } static void alloc_commit_fd_uobject(struct ib_uobject *uobj)