qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 3/3] coccinelle: Remove unnecessary variables


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v3 3/3] coccinelle: Remove unnecessary variables for function return value
Date: Tue, 14 Jun 2016 13:20:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> 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 @"?

No objection.  However, the existing semantic patches in
scripts/coccinelle/ don't do that.  You guys tell me what to do with
this one.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]