From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932619AbbFIHD7 (ORCPT ); Tue, 9 Jun 2015 03:03:59 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:34106 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbbFIHDw (ORCPT ); Tue, 9 Jun 2015 03:03:52 -0400 Date: Tue, 9 Jun 2015 08:03:47 +0100 From: Lee Jones To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, lgirdwood@gmail.com Subject: Re: [PATCH 5/8] regulator: pwm-regulator: Don't assign structure attributes right away Message-ID: <20150609070347.GE2982@x1> References: <1433529771-24496-1-git-send-email-lee.jones@linaro.org> <1433529771-24496-6-git-send-email-lee.jones@linaro.org> <20150608180718.GR14071@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150608180718.GR14071@sirena.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 08 Jun 2015, Mark Brown wrote: > On Fri, Jun 05, 2015 at 07:42:48PM +0100, Lee Jones wrote: > > Perhaps this is just personal preference, but ... > > Possibly... > > > Prevents this kind of nonsense: > > > this->is->just.silly = fetch_silly_value(&pointer); > > if (!this->is->just.silly) { > > printk("Silly value failed: %d\n", this->is->just.silly); > > return this->is->just.silly; > > } > > But we don't have any of that code? Well, one if statement where we > check config.init_data but that's it. A temporary does help with things > like the above but we're not doing that in this driver are we? Admittedly this is an extreme example, but I do consider: init_data = of_get_regulator_init_data(); if (init_data) return -ENOMEM; ... neater than: config.init_data = of_get_regulator_init_data(); if (!config.init_data) return -ENOMEM; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog