qemu-e2k/hw/sd
Vladimir Sementsov-Ogievskiy de1b3800b7 sd: Use ERRP_GUARD()
If we want to check error after errp-function call, we need to
introduce local_err and then propagate it to errp. Instead, use
the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or
   &error_fatal, this means that we don't break error_abort
   (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or
error_append_hint()), we must use the ERRP_GUARD() macro.
Otherwise, this info will not be added when errp == &error_fatal
(the program will exit prior to the error_append_hint() or
error_prepend() call).  No such cases are being fixed here.

This commit is generated by command

    sed -n '/^SD (Secure Card)$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-4-armbru@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci.  Commit message
tweaked again.]
2020-07-10 15:18:09 +02:00
..
allwinner-sdhost.c hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
aspeed_sdhci.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
bcm2835_sdhost.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
core.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
Kconfig hw/sd/sdhci: Move PCI-related code into a separate file 2019-03-12 07:49:04 +01:00
Makefile.objs hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
milkymist-memcard.c sd/milkymist-memcard: Plug minor memory leak in realize 2020-07-02 06:25:29 +02:00
omap_mmc.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pl181.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pxa2xx_mmci.c sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error 2020-06-23 16:07:07 +02:00
sd.c qdev: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
sdhci-internal.h sd: sdhci: Implement basic vendor specific register support 2020-06-16 10:32:29 +01:00
sdhci-pci.c sd: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
sdhci.c sd: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
sdmmc-internal.c sdcard: Display command name when tracing CMD/ACMD 2018-03-09 17:09:44 +00:00
sdmmc-internal.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
ssi-sd.c sd: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
trace-events hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00