v2 of the previous "error: Remove NULL checks on error_propagate() calls" patch, now it became a series.
Changes v1 -> v2: * The Coccinelle scripts were simplified by using "when" constraints to detect when a variable is not used elsewhere inside the function. * Added script to remove unnecessary variables for function return value. * Coccinelle scripts added to scripts/coccinelle. Eduardo Habkost (3): error: Remove NULL checks on error_propagate() calls error: Remove unnecessary local_err variables [RFC] Remove unnecessary variables for function return value audio/audio.c | 10 ++----- block.c | 26 ++++------------- block/archipelago.c | 4 +-- block/qcow2-cluster.c | 7 ++--- block/qcow2-refcount.c | 7 ++--- block/qcow2.c | 4 +-- block/quorum.c | 4 +-- block/raw-posix.c | 24 +++------------ block/raw_bsd.c | 9 +----- block/rbd.c | 5 +--- block/snapshot.c | 4 +-- block/vmdk.c | 6 ++-- block/vvfat.c | 5 +--- blockdev.c | 26 +++++------------ bootdevice.c | 4 +-- dump.c | 4 +-- hw/acpi/aml-build.c | 13 ++------- hw/audio/intel-hda.c | 5 +--- hw/display/vga.c | 4 +-- hw/ide/qdev.c | 4 +-- hw/intc/s390_flic_kvm.c | 5 ++-- hw/net/ne2000-isa.c | 4 +-- hw/pci-host/uninorth.c | 5 +--- hw/ppc/spapr_vio.c | 7 +---- hw/s390x/s390-virtio-ccw.c | 5 +--- hw/s390x/virtio-ccw.c | 42 +++++---------------------- hw/scsi/megasas.c | 10 +------ hw/scsi/scsi-generic.c | 5 +--- hw/timer/mc146818rtc.c | 5 +--- hw/usb/dev-storage.c | 4 +-- hw/virtio/virtio-pci.c | 4 +-- linux-user/signal.c | 15 +++------- page_cache.c | 5 +--- qga/commands-posix.c | 4 +-- qga/commands-win32.c | 14 ++------- qobject/qlist.c | 5 +--- qom/object.c | 4 +-- scripts/coccinelle/error_propagate_null.cocci | 10 +++++++ scripts/coccinelle/remove_local_err.cocci | 27 +++++++++++++++++ scripts/coccinelle/return_directly.cocci | 19 ++++++++++++ target-i386/cpu.c | 4 +-- target-i386/fpu_helper.c | 10 ++----- target-i386/kvm.c | 5 ++-- target-mips/dsp_helper.c | 15 ++-------- target-mips/op_helper.c | 4 +-- target-s390x/helper.c | 6 +--- target-sparc/cc_helper.c | 25 ++++------------ target-tricore/op_helper.c | 13 +++------ tests/display-vga-test.c | 6 +--- tests/endianness-test.c | 5 +--- tests/i440fx-test.c | 4 +-- tests/intel-hda-test.c | 6 +--- tests/test-filter-redirector.c | 6 +--- tests/virtio-blk-test.c | 5 +--- tests/virtio-console-test.c | 6 +--- tests/virtio-net-test.c | 6 +--- tests/virtio-scsi-test.c | 6 +--- tests/wdt_ib700-test.c | 6 +--- ui/cursor.c | 10 ++----- ui/qemu-pixman.c | 11 ++----- util/module.c | 6 +--- vl.c | 5 +--- 62 files changed, 160 insertions(+), 384 deletions(-) create mode 100644 scripts/coccinelle/error_propagate_null.cocci create mode 100644 scripts/coccinelle/remove_local_err.cocci create mode 100644 scripts/coccinelle/return_directly.cocci -- 2.5.5