Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jason Gunthorpe" <jgg@nvidia.com>
Cc: kvm@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH v5 06/10] vfio: selftests: Allow drivers to specify required region size
Date: Thu, 10 Sep 2026 23:58:26 +0000	[thread overview]
Message-ID: <20260910235826.ADFC41F00893@smtp.kernel.org> (raw)
In-Reply-To: <6-v5-4cacb99249f6+1b4-mlx5st_jgg@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Format string type mismatch for size_t variable breaks build on 32-bit architectures due to -Werror.
--

commit 4aa3e6c27ff1032b734b64f7f2efb3d24be4bc07
Author: Jason Gunthorpe <jgg@ziepe.ca>

vfio: selftests: Allow drivers to specify required region size

This commit adds a region_size field to struct vfio_pci_driver_ops, allowing
drivers to declare their required DMA-mapped region size. It updates existing
drivers to pass the size of their state struct and removes the hardcoded
SZ_2M allocation.

> diff --git a/tools/testing/selftests/vfio/lib/iova_allocator.c b/tools/testing/selftests/vfio/lib/iova_allocator.c
> index 4a660f636f497..f70172f9ceb95 100644
> --- a/tools/testing/selftests/vfio/lib/iova_allocator.c
> +++ b/tools/testing/selftests/vfio/lib/iova_allocator.c
[ ... ]
> @@ -50,7 +52,10 @@ void iova_allocator_cleanup(struct iova_allocator *allocator)
>  iova_t iova_allocator_alloc(struct iova_allocator *allocator, size_t size)
>  {
>  	VFIO_ASSERT_GT(size, 0, "Invalid size arg, zero\n");
> -	VFIO_ASSERT_EQ(size & (size - 1), 0, "Invalid size arg, non-power-of-2\n");
> +
> +	VFIO_ASSERT_LE(size, rounddown_pow_of_two(SIZE_MAX),
> +		       "Invalid size arg, too large (%lu)\n", size);

[Severity: Low]
Will this cause a format string warning on 32-bit architectures?

Since size is of type size_t, which is typically unsigned int on 32-bit
builds, using %lu could trigger a build failure due to -Werror. Would it
be better to use %zu here?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/0-v5-4cacb99249f6+1b4-mlx5st_jgg@nvidia.com?part=6

  reply	other threads:[~2026-09-10 23:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 23:57 [PATCH v5 00/10] mlx5 support for VFIO self test Jason Gunthorpe
2026-09-09 23:57 ` [PATCH v5 01/10] net/mlx5: Add IFC structures for CQE and WQE Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 02/10] net/mlx5: Move HW constant groups from device.h/cq.h to mlx5_ifc.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 03/10] net/mlx5: Extract MLX5_SET/GET macros into mlx5_ifc_macros.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 04/10] net/mlx5: Add ONCE and MMIO accessor variants to mlx5_ifc_macros.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 05/10] selftests: Add additional kernel functions to tools/include/ Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 06/10] vfio: selftests: Allow drivers to specify required region size Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot [this message]
2026-09-09 23:57 ` [PATCH v5 07/10] vfio: selftests: Add dev_dbg Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 08/10] vfio: selftests: Add mlx5 driver - HW init and command interface Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 09/10] vfio: selftests: Add mlx5 driver - data path and memcpy ops Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 10/10] vfio: selftests: mlx5 driver - add send_msi support Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot

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=20260910235826.ADFC41F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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