qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: marcandre.lureau@gmail.com, arei.gonglei@huawei.com,
	philmd@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v6] backends/cryptodev: drop local_err from cryptodev_backend_complete()
Date: Fri, 29 Nov 2019 07:10:55 +0100	[thread overview]
Message-ID: <874kynyzyo.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20191127194541.24304-1-vsementsov@virtuozzo.com> (Vladimir Sementsov-Ogievskiy's message of "Wed, 27 Nov 2019 22:45:41 +0300")

Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:

> No reason for local_err here, use errp directly instead.

Related: "[PATCH v6] hw/vfio/ap: drop local_err from vfio_ap_realize".
I'm surprised it's just two.  Did you search for the anti-pattern
systematically?

> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>
> v6: add r-b by Philippe and Marc-André
>
>  backends/cryptodev.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/backends/cryptodev.c b/backends/cryptodev.c
> index 3c071eab95..5a9735684e 100644
> --- a/backends/cryptodev.c
> +++ b/backends/cryptodev.c
> @@ -176,19 +176,10 @@ cryptodev_backend_complete(UserCreatable *uc, Error **errp)
>  {
>      CryptoDevBackend *backend = CRYPTODEV_BACKEND(uc);
>      CryptoDevBackendClass *bc = CRYPTODEV_BACKEND_GET_CLASS(uc);
> -    Error *local_err = NULL;
>  
>      if (bc->init) {
> -        bc->init(backend, &local_err);
> -        if (local_err) {
> -            goto out;
> -        }
> +        bc->init(backend, errp);
>      }
> -
> -    return;
> -
> -out:
> -    error_propagate(errp, local_err);
>  }
>  
>  void cryptodev_backend_set_used(CryptoDevBackend *backend, bool used)

Reviewed-by: Markus Armbruster <armbru@redhat.com>



  parent reply	other threads:[~2019-11-29  6:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 19:45 [PATCH v6] backends/cryptodev: drop local_err from cryptodev_backend_complete() Vladimir Sementsov-Ogievskiy
2019-11-28  7:13 ` Gonglei (Arei)
2019-11-29  6:10 ` Markus Armbruster [this message]
2019-11-29  8:31   ` Vladimir Sementsov-Ogievskiy
2019-11-29 12:09     ` Markus Armbruster

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=874kynyzyo.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).