# Re: \[PATCH\] ib\_ehca: fix compile failure on ppc64

- From: Roland Dreier \<hidden\>
- Date: 2012-02-28 05:18:35 
- List: linux-rdma
- Page: https://ratatoskr.run/linux-rdma/2012/02/15417433
- Thread: https://ratatoskr.run/linux-rdma/2012/02/15417433/t.md

```text
On Mon, Feb 27, 2012 at 2:02 PM, Kyle McMartin [ref] wrote:
>  static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca)
>  {
> -       return 1UL << ilog2(shca->hca_cap_mr_pgsize);
> +       u32 pgsize = shca->hca_cap_mr_pgsize;
> +       return 1UL << ilog2(pgsize);
>  }

How about using rounddown_pow_of_two(shca->hca_cap_mr_pgsize)?
Does that build?  Because that seems to me to be a cleaner way of
expressing this anyway...

Something about that ilog2() implementation seems to trigger gcc
bugs, I seem to remember some other bogus compile failure on
sparc involving it as well...

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
