lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 Apr 2017 10:04:31 +0200
From:   "Luis R. Rodriguez" <mcgrof@...nel.org>
To:     Luca Coelho <luca@...lho.fi>
Cc:     "Luis R. Rodriguez" <mcgrof@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "pjones@...hat.com" <pjones@...hat.com>,
        "moritz.fischer@...us.com" <moritz.fischer@...us.com>,
        "takahiro.akashi@...aro.org" <takahiro.akashi@...aro.org>,
        "dhowells@...hat.com" <dhowells@...hat.com>,
        "pmladek@...e.com" <pmladek@...e.com>,
        "Berg, Johannes" <johannes.berg@...el.com>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>,
        "yi1.li@...ux.intel.com" <yi1.li@...ux.intel.com>,
        "kvalo@...eaurora.org" <kvalo@...eaurora.org>,
        "luto@...nel.org" <luto@...nel.org>,
        "arend.vanspriel@...adcom.com" <arend.vanspriel@...adcom.com>,
        "rafal@...ecki.pl" <rafal@...ecki.pl>,
        "dwmw2@...radead.org" <dwmw2@...radead.org>,
        "wagi@...om.org" <wagi@...om.org>,
        "atull@...nsource.altera.com" <atull@...nsource.altera.com>,
        "Grumbach, Emmanuel" <emmanuel.grumbach@...el.com>
Subject: Re: [PATCH v6 2/5] firmware: add extensible driver data API

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 = &params->priv_params;
> > > > +   const struct driver_data_req_params *req_params = &params->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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ