2023-01-10 03:04:36

by Liming Wu

[permalink] [raw]
Subject: [PATCH] vhost: remove unused paramete

From: Liming Wu <[email protected]>

"enabled" is defined in vhost_init_device_iotlb,
but it is never used. Let's remove it.

Signed-off-by: Liming Wu <[email protected]>
---
drivers/vhost/net.c | 2 +-
drivers/vhost/vhost.c | 2 +-
drivers/vhost/vhost.h | 2 +-
drivers/vhost/vsock.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 9af19b0cf3b7..135e23254a26 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1642,7 +1642,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)
goto out_unlock;

if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
- if (vhost_init_device_iotlb(&n->dev, true))
+ if (vhost_init_device_iotlb(&n->dev))
goto out_unlock;
}

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index cbe72bfd2f1f..34458e203716 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1729,7 +1729,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
}
EXPORT_SYMBOL_GPL(vhost_vring_ioctl);

-int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled)
+int vhost_init_device_iotlb(struct vhost_dev *d)
{
struct vhost_iotlb *niotlb, *oiotlb;
int i;
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index d9109107af08..4bfa10e52297 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -221,7 +221,7 @@ ssize_t vhost_chr_read_iter(struct vhost_dev *dev, struct iov_iter *to,
int noblock);
ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
struct iov_iter *from);
-int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled);
+int vhost_init_device_iotlb(struct vhost_dev *d);

void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
struct vhost_iotlb_map *map);
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index a2b374372363..1ffa36eb3efb 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -829,7 +829,7 @@ static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features)
}

if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
- if (vhost_init_device_iotlb(&vsock->dev, true))
+ if (vhost_init_device_iotlb(&vsock->dev))
goto err;
}

--
2.25.1


2023-01-11 08:43:00

by Stefano Garzarella

[permalink] [raw]
Subject: Re: [PATCH] vhost: remove unused paramete

On Tue, Jan 10, 2023 at 10:44:45AM +0800, [email protected] wrote:
>From: Liming Wu <[email protected]>
>
>"enabled" is defined in vhost_init_device_iotlb,
>but it is never used. Let's remove it.
>
>Signed-off-by: Liming Wu <[email protected]>
>---
> drivers/vhost/net.c | 2 +-
> drivers/vhost/vhost.c | 2 +-
> drivers/vhost/vhost.h | 2 +-
> drivers/vhost/vsock.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)

Little typo in the title s/paramete/parameter.

A part of that, the patch LGTM:

Reviewed-by: Stefano Garzarella <[email protected]>

Thanks,
Stefano

2023-01-11 10:27:39

by Eugenio Perez Martin

[permalink] [raw]
Subject: Re: [PATCH] vhost: remove unused paramete

On Tue, Jan 10, 2023 at 3:46 AM <[email protected]> wrote:
>
> From: Liming Wu <[email protected]>
>
> "enabled" is defined in vhost_init_device_iotlb,
> but it is never used. Let's remove it.
>
> Signed-off-by: Liming Wu <[email protected]>

Reviewed-by: Eugenio PĂ©rez <[email protected]>

Thanks!

> ---
> drivers/vhost/net.c | 2 +-
> drivers/vhost/vhost.c | 2 +-
> drivers/vhost/vhost.h | 2 +-
> drivers/vhost/vsock.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 9af19b0cf3b7..135e23254a26 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -1642,7 +1642,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)
> goto out_unlock;
>
> if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
> - if (vhost_init_device_iotlb(&n->dev, true))
> + if (vhost_init_device_iotlb(&n->dev))
> goto out_unlock;
> }
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index cbe72bfd2f1f..34458e203716 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1729,7 +1729,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
> }
> EXPORT_SYMBOL_GPL(vhost_vring_ioctl);
>
> -int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled)
> +int vhost_init_device_iotlb(struct vhost_dev *d)
> {
> struct vhost_iotlb *niotlb, *oiotlb;
> int i;
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index d9109107af08..4bfa10e52297 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -221,7 +221,7 @@ ssize_t vhost_chr_read_iter(struct vhost_dev *dev, struct iov_iter *to,
> int noblock);
> ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
> struct iov_iter *from);
> -int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled);
> +int vhost_init_device_iotlb(struct vhost_dev *d);
>
> void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
> struct vhost_iotlb_map *map);
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> index a2b374372363..1ffa36eb3efb 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -829,7 +829,7 @@ static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features)
> }
>
> if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
> - if (vhost_init_device_iotlb(&vsock->dev, true))
> + if (vhost_init_device_iotlb(&vsock->dev))
> goto err;
> }
>
> --
> 2.25.1
>

2023-01-16 09:28:24

by Liming Wu

[permalink] [raw]
Subject: RE: [PATCH] vhost: remove unused paramete


> -----Original Message-----
> From: Stefano Garzarella <[email protected]>
> Sent: Wednesday, January 11, 2023 4:25 PM
> To: Liming Wu <[email protected]>
> Cc: Michael S . Tsirkin <[email protected]>; Jason Wang
> <[email protected]>; [email protected]; [email protected]
> foundation.org; [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH] vhost: remove unused paramete
>
> On Tue, Jan 10, 2023 at 10:44:45AM +0800, [email protected] wrote:
> >From: Liming Wu <[email protected]>
> >
> >"enabled" is defined in vhost_init_device_iotlb, but it is never used.
> >Let's remove it.
> >
> >Signed-off-by: Liming Wu <[email protected]>
> >---
> > drivers/vhost/net.c | 2 +-
> > drivers/vhost/vhost.c | 2 +-
> > drivers/vhost/vhost.h | 2 +-
> > drivers/vhost/vsock.c | 2 +-
> > 4 files changed, 4 insertions(+), 4 deletions(-)
>
> Little typo in the title s/paramete/parameter.
Thanks for the hints!
Do I need to resend this patch.

> A part of that, the patch LGTM:
>
> Reviewed-by: Stefano Garzarella <[email protected]>
>

Thanks,
Liming Wu