Received: from eggs.gnu.org ([2001:4830:134:3::10]:57689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCmz0-0002xc-LX for qemu-devel@nongnu.org; Tue, 14 Jun 2016 07:58:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCmyw-0006xU-IY for qemu-devel@nongnu.org; Tue, 14 Jun 2016 07:58:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCmyw-0006xQ-C4 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 07:58:10 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6AE3C01AC42 for ; Tue, 14 Jun 2016 11:58:09 +0000 (UTC) Date: Tue, 14 Jun 2016 08:58:07 -0300 From: Eduardo Habkost Message-ID: <20160614115807.GI17952@thinpad.lan.raisama.net> 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> <87oa74f24x.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87oa74f24x.fsf@dusky.pond.sub.org> 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 Cc: Paolo Bonzini , qemu-devel@nongnu.org On Tue, Jun 14, 2016 at 01:20:14PM +0200, Markus Armbruster wrote: > Paolo Bonzini 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. I think rule names are just noise if the script has only a single transformation. In this specific case, the comment and the rule name were kept by mistake. -- Eduardo