On Sat,  9 Sep 2023 12:18:30 +0000
Wei Hu <w...@microsoft.com> wrote:

> diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
> index 7630118d4f..a20ca1a988 100644
> --- a/drivers/net/mana/mana.c
> +++ b/drivers/net/mana/mana.c
> @@ -1260,7 +1260,7 @@ mana_probe_port(struct ibv_device *ibdev, struct 
> ibv_device_attr_ex *dev_attr,
>       /* Create a parent domain with the port number */
>       attr.pd = priv->ib_pd;
>       attr.comp_mask = IBV_PARENT_DOMAIN_INIT_ATTR_PD_CONTEXT;
> -     attr.pd_context = (void *)(uint64_t)port;
> +     attr.pd_context = (void *)(size_t)port;

Since port is uint8_t, the better cast would be to uintptr_t which
is always an unsigned value of same size as pointer.

Also, not sure why using PRIxPTR is necessary; on all arch and platforms %p 
should
work for printing a pointer and is more common usage.

Reply via email to