Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755500AbdGKIMy (ORCPT ); Tue, 11 Jul 2017 04:12:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:37362 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754510AbdGKIMw (ORCPT ); Tue, 11 Jul 2017 04:12:52 -0400 Message-ID: <1499760630.3700.2.camel@suse.com> Subject: Re: [PATCH] usb: isp1760: compress return logic into one line From: Oliver Neukum To: "Gustavo A. R. Silva" Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Tue, 11 Jul 2017 10:10:30 +0200 In-Reply-To: <20170710145811.Horde.met9v3oXkVEKp-ml-mFMK-d@gator4166.hostgator.com> References: <20170710020007.GA30095@embeddedgus> <1499672197.12673.1.camel@suse.com> <20170710145811.Horde.met9v3oXkVEKp-ml-mFMK-d@gator4166.hostgator.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 36 Am Montag, den 10.07.2017, 14:58 -0500 schrieb Gustavo A. R. Silva : > Hi Oliver, > > Quoting Oliver Neukum : > > > > > Am Sonntag, den 09.07.2017, 21:00 -0500 schrieb Gustavo A. R. Silva : > > > > > > Simplify return logic to avoid unnecessary variable assignment. > > > > > > This issue was detected using Coccinelle and the following > > > semantic patch: > > > > > > > Hi, > > > > I need to ask: Where is the improvement? The compiler does not bother > > and for the human reader you do not do anything obvious and you > > decreased grepability. > > > > The declaration of local variable _retval_ was removed also. > So both, variable declaration and assignment removal are the improvements. Yeah, but a variable called "retval" has an extremely clear function. Simplifying code is an improvement. Making it clearer is an improvement. I am sorry but the proposed change is almost like removing blank lines to make it more compact > Regarding the greability, I think that depends on the context. "retval" has a clear function and is unique. Regards Oliver