DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Wei Hu <weh@microsoft.com>
Cc: dev@dpdk.org, Long Li <longli@microsoft.com>, stable@dpdk.org
Subject: Re: [PATCH 1/1] net/mana: enable 32 bit build for mana driver
Date: Sat, 9 Sep 2023 07:51:54 -0700	[thread overview]
Message-ID: <20230909075154.038f6b35@hermes.local> (raw)
In-Reply-To: <20230909121830.2043779-1-weh@microsoft.com>

On Sat,  9 Sep 2023 12:18:30 +0000
Wei Hu <weh@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	other threads:[~2023-09-09 14:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-09 12:18 Wei Hu
2023-09-09 14:51 ` Stephen Hemminger [this message]
2023-09-12 12:48   ` Wei Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230909075154.038f6b35@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=longli@microsoft.com \
    --cc=stable@dpdk.org \
    --cc=weh@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).