[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 3/3] coccinelle: Remove unnecessary variables
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 3/3] coccinelle: Remove unnecessary variables for function return value |
Date: |
Tue, 14 Jun 2016 11:11:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 14/06/2016 10:57, Markus Armbruster wrote:
>> diff --git a/scripts/coccinelle/return_directly.cocci
>> b/scripts/coccinelle/return_directly.cocci
>> > new file mode 100644
>> > index 0000000..c52f4fc
>> > --- /dev/null
>> > +++ b/scripts/coccinelle/return_directly.cocci
>> > @@ -0,0 +1,21 @@
>> > +// replace 'R = X; return R;' with 'return R;'
>> > +
>> > +// remove assignment
> Second comment feels redundant. Can drop on commit to error-next.
>
>> > +@ removal @
> Rule name "removal" is not used. Can drop on commit to error-next.
>
I've seen rule names used as a comment. Feels a bit like COBOL, but it
doesn't hurt. Perhaps rename it to "@ return_directly @"?
Paolo
Re: [Qemu-devel] [PATCH v3 0/3] coccinelle: Clean up error checks and return value variables, Markus Armbruster, 2016/06/14