All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] vfio: use matching sizeof type
Date: Thu, 18 Jan 2024 13:09:16 +0800	[thread overview]
Message-ID: <ZaiyfDX2-hUUynhp@x1n> (raw)
In-Reply-To: <20240117160344.175872-1-pbonzini@redhat.com>

On Wed, Jan 17, 2024 at 05:03:44PM +0100, Paolo Bonzini wrote:
> Do not use uint64_t for the type of the declaration and __u64 when
> computing the number of elements in the array.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/vfio/common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 0b3352f2a9d..0da4003ecf5 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -1118,7 +1118,7 @@ static int vfio_device_dma_logging_report(VFIODevice *vbasedev, hwaddr iova,
>  {
>      uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature) +
>                          sizeof(struct vfio_device_feature_dma_logging_report),
> -                        sizeof(__u64))] = {};
> +                        sizeof(uint64_t))] = {};
>      struct vfio_device_feature *feature = (struct vfio_device_feature *)buf;
>      struct vfio_device_feature_dma_logging_report *report =
>          (struct vfio_device_feature_dma_logging_report *)feature->data;

There seem to have other places in the sme file that reference __u64.  Are
we going to remove all __u64 references?  Or maybe something else?

Copy Alex/Cedric to make sure this won't get lost..

Thanks,

-- 
Peter Xu



  parent reply	other threads:[~2024-01-18  5:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 16:03 [PATCH] vfio: use matching sizeof type Paolo Bonzini
2024-01-17 17:05 ` Philippe Mathieu-Daudé
2024-01-18  5:09 ` Peter Xu [this message]
2024-01-18  7:24   ` Cédric Le Goater
2024-01-18  7:30   ` Paolo Bonzini

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=ZaiyfDX2-hUUynhp@x1n \
    --to=peterx@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=clg@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.