qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 1/3] error: Remove NULL checks on error_propa


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v2 1/3] error: Remove NULL checks on error_propagate() calls
Date: Fri, 10 Jun 2016 14:54:09 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/10/2016 02:12 PM, Eduardo Habkost wrote:
> error_propagate() already ignores local_err==NULL, so there's no
> need to check it before calling.
> 
> Coccinelle patch used to perform the changes added to
> scripts/coccinelle/error_propagate_null.cocci.
> 
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
>  block.c                                       | 20 +++++--------------
>  block/qcow2.c                                 |  4 +---
>  block/quorum.c                                |  4 +---
>  block/raw-posix.c                             | 16 ++++-----------
>  block/raw_bsd.c                               |  4 +---
>  block/snapshot.c                              |  4 +---
>  blockdev.c                                    | 12 +++---------
>  bootdevice.c                                  |  4 +---
>  dump.c                                        |  4 +---
>  hw/ide/qdev.c                                 |  4 +---
>  hw/net/ne2000-isa.c                           |  4 +---
>  hw/s390x/virtio-ccw.c                         | 28 
> +++++++--------------------
>  hw/usb/dev-storage.c                          |  4 +---
>  qga/commands-win32.c                          |  8 ++------
>  qom/object.c                                  |  4 +---
>  scripts/coccinelle/error_propagate_null.cocci | 10 ++++++++++
>  16 files changed, 41 insertions(+), 93 deletions(-)
>  create mode 100644 scripts/coccinelle/error_propagate_null.cocci

You can do:
git config diff.orderFile /path/to/file

and then set up a list of globs in /path/to/file in order to influence
your diffs; in my case, I stuck 'scripts/coccinelle/*' near the top of
my order file, as I find that to be a more useful part of the patch than
the churn from running it.  But it doesn't affect patch correctness,
just ease of review.

Reviewed-by: Eric Blake <address@hidden>

> +++ b/scripts/coccinelle/error_propagate_null.cocci
> @@ -0,0 +1,10 @@
> +// error_propagate() already ignores local_err==NULL, so there's
> +// no need to check it before calling.
> +
> +@@
> +identifier L;
> +expression E;
> +@@
> +-if (L) {
> +     error_propagate(E, L);
> +-}
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]