[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument
From: |
Eric Blake |
Subject: |
Re: [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument |
Date: |
Mon, 23 Sep 2019 13:35:51 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 9/23/19 11:12 AM, Vladimir Sementsov-Ogievskiy wrote:
> Error **errp is almost always OUT-argument: it's assumed to be NULL, or
> pointer to NULL-initialized pointer, or pointer to error_abort or
> error_fatal, for callee to report error.
>
> But very few functions (most of the are error API) instead get Error
> **errp as IN-argument: it's assumed to be set, and callee should clean
> it. In such cases, rename errp to errp_in.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> include/monitor/hmp.h | 2 +-
> include/qapi/error.h | 8 ++++----
> ui/vnc.h | 2 +-
> monitor/hmp-cmds.c | 8 ++++----
> ui/vnc.c | 10 +++++-----
> util/error.c | 2 +-
> 6 files changed, 16 insertions(+), 16 deletions(-)
This is worthwhile, regardless of the fate of the rest of the series.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [RFC v2 5/9] net/net: fix local variable shadowing in net_client_init, (continued)
- [RFC v2 5/9] net/net: fix local variable shadowing in net_client_init, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 7/9] Use auto-propagated errp, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 2/9] qapi/error: add (Error **errp) cleaning APIs, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 1/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument, Vladimir Sementsov-Ogievskiy, 2019/09/23
- Re: [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument,
Eric Blake <=
- [RFC v2 9/9] fix-compilation: includes, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 8/9] fix-compilation: empty goto, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 4/9] hw/core/loader-fit: fix freeing errp in fit_load_fdt, Vladimir Sementsov-Ogievskiy, 2019/09/23
- Re: [RFC v2 0/9] error: auto propagated local_err, Eric Blake, 2019/09/23