lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] vfio/mdev: don't warn if ->request is not set
Date
On Mon, Jul 26 2021, Christoph Hellwig <hch@lst.de> wrote:

> Only a single driver actually sets the ->request method, so don't print
> a scary warning if it isn't.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/vfio/mdev/mdev_core.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
> index b16606ebafa1..b314101237fe 100644
> --- a/drivers/vfio/mdev/mdev_core.c
> +++ b/drivers/vfio/mdev/mdev_core.c
> @@ -138,10 +138,6 @@ int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops)
> if (!dev)
> return -EINVAL;
>
> - /* Not mandatory, but its absence could be a problem */
> - if (!ops->request)
> - dev_info(dev, "Driver cannot be asked to release device\n");
> -
> mutex_lock(&parent_list_lock);
>
> /* Check for duplicate */

We also log a warning if we would like to call ->request() but none was
provided, so I think that's fine.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

But I wonder why nobody else implements this? Lack of surprise removal?

\
 
 \ /
  Last update: 2021-07-26 19:09    [W:0.099 / U:1.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site