Received: from eggs.gnu.org ([2001:4830:134:3::10]:49926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCkNz-00026c-0d for qemu-devel@nongnu.org; Tue, 14 Jun 2016 05:11:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCkNt-0004cI-Uj for qemu-devel@nongnu.org; Tue, 14 Jun 2016 05:11:49 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCkNt-0004cD-N3 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 05:11:45 -0400 Received: by mail-wm0-x241.google.com with SMTP id k184so20727851wme.2 for ; Tue, 14 Jun 2016 02:11:45 -0700 (PDT) Sender: Paolo Bonzini References: <1465855078-19435-1-git-send-email-ehabkost@redhat.com> <1465855078-19435-4-git-send-email-ehabkost@redhat.com> <87d1nkkv07.fsf@dusky.pond.sub.org> From: Paolo Bonzini Message-ID: Date: Tue, 14 Jun 2016 11:11:42 +0200 MIME-Version: 1.0 In-Reply-To: <87d1nkkv07.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 3/3] coccinelle: Remove unnecessary variables for function return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Eduardo Habkost Cc: qemu-devel@nongnu.org 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