Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] IB/core: Fix build failure without hugepages
@ 2020-01-09  8:47 Arnd Bergmann
  2020-01-09 16:00 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-01-09  8:47 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe, Leon Romanovsky, Yishai Hadas,
	Artemy Kovalyov
  Cc: Arnd Bergmann, Leon Romanovsky, Jason Gunthorpe, Ira Weiny,
	Moni Shoua, John Hubbard, Shiraz Saleem, linux-rdma,
	linux-kernel

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@arndb.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] IB/core: Fix build failure without hugepages
  2020-01-09  8:47 [PATCH] IB/core: Fix build failure without hugepages Arnd Bergmann
@ 2020-01-09 16:00 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-01-09 16:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Doug Ledford, Leon Romanovsky, Yishai Hadas, Artemy Kovalyov,
	Leon Romanovsky, Ira Weiny, Moni Shoua, John Hubbard,
	Shiraz Saleem, linux-rdma, linux-kernel

On Thu, Jan 09, 2020 at 09:47:30AM +0100, Arnd Bergmann wrote:
> 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@arndb.de>
> ---
>  drivers/infiniband/core/umem_odp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09  8:47 [PATCH] IB/core: Fix build failure without hugepages Arnd Bergmann
2020-01-09 16:00 ` Jason Gunthorpe

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git