Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968102AbdD0IEh (ORCPT ); Thu, 27 Apr 2017 04:04:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:56804 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754234AbdD0IEe (ORCPT ); Thu, 27 Apr 2017 04:04:34 -0400 Date: Thu, 27 Apr 2017 10:04:31 +0200 From: "Luis R. Rodriguez" To: Luca Coelho Cc: "Luis R. Rodriguez" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "pjones@redhat.com" , "moritz.fischer@ettus.com" , "takahiro.akashi@linaro.org" , "dhowells@redhat.com" , "pmladek@suse.com" , "Berg, Johannes" , "rjw@rjwysocki.net" , "yi1.li@linux.intel.com" , "kvalo@codeaurora.org" , "luto@kernel.org" , "arend.vanspriel@broadcom.com" , "rafal@milecki.pl" , "dwmw2@infradead.org" , "wagi@monom.org" , "atull@opensource.altera.com" , "Grumbach, Emmanuel" Subject: Re: [PATCH v6 2/5] firmware: add extensible driver data API Message-ID: <20170427080430.GK28800@wotan.suse.de> References: <20170330032514.17173-1-mcgrof@kernel.org> <20170330032514.17173-3-mcgrof@kernel.org> <1491828162.31980.50.camel@intel.com> <20170427031625.GI28800@wotan.suse.de> <1493271867.14233.11.camel@coelho.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1493271867.14233.11.camel@coelho.fi> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1612 Lines: 46 On Thu, Apr 27, 2017 at 08:44:27AM +0300, Luca Coelho wrote: > On Thu, 2017-04-27 at 05:16 +0200, Luis R. Rodriguez wrote: > > > > @@ -1460,6 +1471,128 @@ void release_firmware(const struct firmware *fw) > > > > ? } > > > > ? EXPORT_SYMBOL(release_firmware); > > > > ? > > > > +static int _driver_data_request_api(struct driver_data_params *params, > > > > +?????????????????????????????? struct device *device, > > > > +?????????????????????????????? const char *name) > > > > +{ > > > > +???struct driver_data_priv_params *priv_params = ¶ms->priv_params; > > > > +???const struct driver_data_req_params *req_params = ¶ms->req_params; > > > > +???int ret; > > > > +???char *try_name; > > > > +???u8 api_max; > > > > + > > > > +???if (priv_params->retry_api) { > > > > +???????????if (!priv_params->api) > > > > +???????????????????return -ENOENT; > > > > +???????????api_max = priv_params->api - 1; > > > > +???} else > > > > +???????????api_max = req_params->api_max; > > > > > > Braces. > > > > Not sure what you mean here, the else is a 1 liner so I skip the brace. > > It's really a nitpick, but the CodingStyle[1] says: > > "Do not unnecessarily use braces where a single statement will do. > [...] > This does not apply if only one branch of a conditional statement is a > single statement; in the latter case use braces in both branches: > > if (condition) { > do_this(); > do_that(); > } else { > otherwise(); > }" > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst#n175 Heh, alright. Added the brace. Luis