From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "marcandre.lureau@gmail.com" <marcandre.lureau@gmail.com>,
"arei.gonglei@huawei.com" <arei.gonglei@huawei.com>,
"philmd@redhat.com" <philmd@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v6] backends/cryptodev: drop local_err from cryptodev_backend_complete()
Date: Fri, 29 Nov 2019 08:31:34 +0000 [thread overview]
Message-ID: <1b532161-7de9-8ea5-0771-69fdeb5b70bc@virtuozzo.com> (raw)
In-Reply-To: <874kynyzyo.fsf@dusky.pond.sub.org>
29.11.2019 9:10, Markus Armbruster wrote:
> 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?
As I remember - no, only where it breaks automation. Here empty "out: }"
label will break compilation, if not fixed before or after coccinelle
run. So, here I fixed it before.
>
>> 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>
>
--
Best regards,
Vladimir
next prev parent reply other threads:[~2019-11-29 8:40 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
2019-11-29 8:31 ` Vladimir Sementsov-Ogievskiy [this message]
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=1b532161-7de9-8ea5-0771-69fdeb5b70bc@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).