[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200109084740.2872079-1-arnd@arndb.de>
Date: Thu, 9 Jan 2020 09:47:30 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Doug Ledford <dledford@...hat.com>, Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
Yishai Hadas <yishaih@...lanox.com>,
Artemy Kovalyov <artemyko@...lanox.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Leon Romanovsky <leonro@...lanox.com>,
Jason Gunthorpe <jgg@...lanox.com>,
Ira Weiny <ira.weiny@...el.com>,
Moni Shoua <monis@...lanox.com>,
John Hubbard <jhubbard@...dia.com>,
Shiraz Saleem <shiraz.saleem@...el.com>,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] IB/core: Fix build failure without hugepages
HPAGE_SHIFT is only defined on architectures that support hugepages:
drivers/infiniband/core/umem_odp.c: In function 'ib_umem_odp_get':
drivers/infiniband/core/umem_odp.c:245:26: error: 'HPAGE_SHIFT' undeclared (first use in this function); did you mean 'PAGE_SHIFT'?
Enclose this in an #ifdef.
Fixes: 9ff1b6466a29 ("IB/core: Fix ODP with IB_ACCESS_HUGETLB handling")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/infiniband/core/umem_odp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index f42fa31c24a2..b9baf7d0a5cb 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -241,10 +241,11 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_udata *udata, unsigned long addr,
umem_odp->umem.owning_mm = mm = current->mm;
umem_odp->notifier.ops = ops;
+ umem_odp->page_shift = PAGE_SHIFT;
+#ifdef CONFIG_HUGETLB_PAGE
if (access & IB_ACCESS_HUGETLB)
umem_odp->page_shift = HPAGE_SHIFT;
- else
- umem_odp->page_shift = PAGE_SHIFT;
+#endif
umem_odp->tgid = get_task_pid(current->group_leader, PIDTYPE_PID);
ret = ib_init_umem_odp(umem_odp, ops);
--
2.20.0
Powered by blists - more mailing lists