Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2018-12-14 Thread Philippe Mathieu-Daudé
On 12/13/18 6:31 PM, Markus Armbruster wrote: > Patch created mechanically by rerunning: > > $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \ > --macro-file scripts/cocci-macro-file.h \ > --dir . --in-place > > Whitespace tidied up manually. > > Signe

Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2018-12-13 Thread Eric Blake
On 12/13/18 11:31 AM, Markus Armbruster wrote: Patch created mechanically by rerunning: $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \ --macro-file scripts/cocci-macro-file.h \ --dir . --in-place Whitespace tidied up manually. Signed-off-by: Ma

[Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2018-12-13 Thread Markus Armbruster
Patch created mechanically by rerunning: $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \ --macro-file scripts/cocci-macro-file.h \ --dir . --in-place Whitespace tidied up manually. Signed-off-by: Markus Armbruster --- blockdev.c | 4 +-

Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2016-06-09 Thread Eduardo Habkost
On Thu, Jun 09, 2016 at 02:11:23PM -0600, Eric Blake wrote: > On 06/09/2016 01:50 PM, Eduardo Habkost wrote: > > On Thu, Jun 09, 2016 at 01:37:23PM -0600, Eric Blake wrote: > > [...] > >> > >> Hmm - it seems like in most of the cases where the ONLY thing done in > >> the if (local_err) block is to

Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2016-06-09 Thread Eric Blake
On 06/09/2016 01:50 PM, Eduardo Habkost wrote: > On Thu, Jun 09, 2016 at 01:37:23PM -0600, Eric Blake wrote: > [...] >> >> Hmm - it seems like in most of the cases where the ONLY thing done in >> the if (local_err) block is to propagate the error, we should instead be >> directly assigning to errp

Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2016-06-09 Thread Eduardo Habkost
On Thu, Jun 09, 2016 at 01:37:23PM -0600, Eric Blake wrote: [...] > > Hmm - it seems like in most of the cases where the ONLY thing done in > the if (local_err) block is to propagate the error, we should instead be > directly assigning to errp instead of wasting a local variable. At this > point,

Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2016-06-09 Thread Eric Blake
On 06/09/2016 11:40 AM, Eduardo Habkost wrote: > error_propagate() already ignores local_err==NULL, so there's no > need to check it before calling. > > Done using the following Coccinelle patch: > > @@ > identifier L; > expression E; > @@ > -if (L) { >error_propagate(E, L); >

[Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls

2016-06-09 Thread Eduardo Habkost
error_propagate() already ignores local_err==NULL, so there's no need to check it before calling. Done using the following Coccinelle patch: @@ identifier L; expression E; @@ -if (L) { error_propagate(E, L); -} Signed-off-by: Eduardo Habkost --- block.c | 20 ++