linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio_config: clarify output parameters
Date: Tue, 2 Sep 2025 07:56:36 -0400	[thread overview]
Message-ID: <CAJSP0QXd3zgMYRUQ3kCcUZ+RbZ6SHHn-kc5K4DV9C8LeU2g78A@mail.gmail.com> (raw)
In-Reply-To: <20250829150944.233505-1-hi@alyssa.is>

On Fri, Aug 29, 2025 at 11:10 AM Alyssa Ross <hi@alyssa.is> wrote:
>
> This was ambiguous enough for a broken patch (206cc44588f7 ("virtio:
> reject shm region if length is zero")) to make it into the kernel, so
> make it clearer.
>
> Link: https://lore.kernel.org/r/20250816071600-mutt-send-email-mst@kernel.org/
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
>  include/linux/virtio_config.h | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
> index 8bf156dde554..7427b79d6f3d 100644
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
> @@ -193,14 +193,15 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
>  }
>
>  static inline void virtio_get_features(struct virtio_device *vdev,
> -                                      u64 *features)
> +                                      u64 *features_out)
>  {
>         if (vdev->config->get_extended_features) {
> -               vdev->config->get_extended_features(vdev, features);
> +               vdev->config->get_extended_features(vdev, features_out);
>                 return;
>         }
>
> -       virtio_features_from_u64(features, vdev->config->get_features(vdev));
> +       virtio_features_from_u64(features_out,
> +               vdev->config->get_features(vdev));
>  }
>
>  /**
> @@ -326,11 +327,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask)
>
>  static inline
>  bool virtio_get_shm_region(struct virtio_device *vdev,
> -                          struct virtio_shm_region *region, u8 id)
> +                          struct virtio_shm_region *region_out, u8 id)
>  {
>         if (!vdev->config->get_shm_region)
>                 return false;
> -       return vdev->config->get_shm_region(vdev, region, id);
> +       return vdev->config->get_shm_region(vdev, region_out, id);
>  }
>
>  static inline bool virtio_is_little_endian(struct virtio_device *vdev)
>
> base-commit: 07d9df80082b8d1f37e05658371b087cb6738770
> --
> 2.50.1
>
>

      reply	other threads:[~2025-09-02 11:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 15:09 [PATCH] virtio_config: clarify output parameters Alyssa Ross
2025-09-02 11:56 ` Stefan Hajnoczi [this message]

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=CAJSP0QXd3zgMYRUQ3kCcUZ+RbZ6SHHn-kc5K4DV9C8LeU2g78A@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=eperezma@redhat.com \
    --cc=hi@alyssa.is \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.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).