From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([92.198.50.35]:49503 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbbE2Msu (ORCPT ); Fri, 29 May 2015 08:48:50 -0400 Date: Fri, 29 May 2015 14:48:48 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Johannes Berg Cc: linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH RFC next 2/2] net: rfkill: gpio: simplify code flow Message-ID: <20150529124848.GM18985@pengutronix.de> (sfid-20150529_144853_524501_5C81D53E) References: <1432806373-17372-1-git-send-email-u.kleine-koenig@pengutronix.de> <1432806373-17372-3-git-send-email-u.kleine-koenig@pengutronix.de> <1432898224.2104.12.camel@sipsolutions.net> <20150529124230.GJ18985@pengutronix.de> <1432903510.16701.0.camel@sipsolutions.net> <20150529124637.GL18985@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <20150529124637.GL18985@pengutronix.de> Sender: linux-wireless-owner@vger.kernel.org List-ID: Hello again, On Fri, May 29, 2015 at 02:46:37PM +0200, Uwe Kleine-König wrote: > On Fri, May 29, 2015 at 02:45:10PM +0200, Johannes Berg wrote: > > On Fri, 2015-05-29 at 14:42 +0200, Uwe Kleine-König wrote: > > > On Fri, May 29, 2015 at 01:17:04PM +0200, Johannes Berg wrote: > > > > On Thu, 2015-05-28 at 11:46 +0200, Uwe Kleine-König wrote: > > > > > When assigning directly to the pointer contained in the driver data the > > > > > local variable can be dropped together with the extra assignment to it. > > > > > > > > I'm not really sure I see the big benefit of this? It doesn't really > > > > seem to make the code much easier to read/follow. > > > > > > > > I also don't really see the (perceived) objection with "dynamic memory" > > > > though since that memory is freed pretty much immediately as soon as we > > > > return a non-zero value from this function ... the function itself > > > > allocates the memory, and clearly we return without it ever being able > > > > to use it, so ... > > > > > > > > Anyway - I might apply this for the few removed lines of code, but only > > > > with a better commit log. > > > Alternatively squash it into patch 1/2 and add: > > > > > > While touching the code simplify it a bit to not need a local > > > variable for the gpio descriptors. > > > > Too late, already applied & pushed out the other one. > Ah, I thought you wanted a better commit log, didn't understand that you > looked into that yourself. Ah, misunderstood once more. Will take a look for a better commit log. Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |