From: Eric Blake <eblake@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, borntraeger@de.ibm.com, qemu-block@nongnu.org,
cornelia.huck@de.ibm.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/3] error: Remove NULL checks on error_propagate() calls
Date: Fri, 10 Jun 2016 14:54:09 -0600 [thread overview]
Message-ID: <575B28F1.7060605@redhat.com> (raw)
In-Reply-To: <1465589538-24998-2-git-send-email-ehabkost@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2309 bytes --]
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 <ehabkost@redhat.com>
> ---
> 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 <eblake@redhat.com>
> +++ 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-06-10 20:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 20:12 [Qemu-devel] [PATCH v2 0/3] coccinelle: Clean up error checks and return value variables Eduardo Habkost
2016-06-10 20:12 ` [Qemu-devel] [PATCH v2 1/3] error: Remove NULL checks on error_propagate() calls Eduardo Habkost
2016-06-10 20:54 ` Eric Blake [this message]
2016-06-13 7:41 ` Cornelia Huck
2016-06-10 20:12 ` [Qemu-devel] [PATCH v2 2/3] error: Remove unnecessary local_err variables Eduardo Habkost
2016-06-10 20:59 ` Eric Blake
2016-06-10 22:39 ` Eduardo Habkost
2016-06-13 7:44 ` Cornelia Huck
2016-06-13 11:42 ` Markus Armbruster
2016-06-13 15:52 ` Eduardo Habkost
2016-06-13 16:01 ` [Qemu-devel] [Qemu-block] " Eric Blake
2016-06-13 18:49 ` Markus Armbruster
2016-06-13 19:42 ` Eduardo Habkost
2016-06-14 8:15 ` Markus Armbruster
2016-06-13 19:40 ` Eduardo Habkost
2016-06-10 20:12 ` [Qemu-devel] [RFC v2 3/3] Remove unnecessary variables for function return value Eduardo Habkost
2016-06-10 21:22 ` Eric Blake
2016-06-13 11:29 ` Markus Armbruster
2016-06-13 21:40 ` Eduardo Habkost
2016-06-14 8:13 ` 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=575B28F1.7060605@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=ehabkost@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).