Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162008AbdD0Fo6 (ORCPT ); Thu, 27 Apr 2017 01:44:58 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:54844 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753209AbdD0Fou (ORCPT ); Thu, 27 Apr 2017 01:44:50 -0400 Message-ID: <1493271867.14233.11.camel@coelho.fi> From: Luca Coelho To: "Luis R. Rodriguez" Cc: "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" Date: Thu, 27 Apr 2017 08:44:27 +0300 In-Reply-To: <20170427031625.GI28800@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 91.156.4.241 X-SA-Exim-Mail-From: luca@coelho.fi Subject: Re: [PATCH v6 2/5] firmware: add extensible driver data API X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on farmhouse.coelho.fi) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1583 Lines: 45 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 -- Cheers, Luca.