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]
Message-ID: <f3490f4e7900e463540330665ecf99737070fedd.camel@fi.rohmeurope.com>
Date:   Wed, 25 Mar 2020 10:14:35 +0000
From:   "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To:     "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
CC:     "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "brendanhiggins@...gle.com" <brendanhiggins@...gle.com>,
        "olteanv@...il.com" <olteanv@...il.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "talgi@...lanox.com" <talgi@...lanox.com>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "davidgow@...gle.com" <davidgow@...gle.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "yamada.masahiro@...ionext.com" <yamada.masahiro@...ionext.com>,
        "Mutanen, Mikko" <Mikko.Mutanen@...rohmeurope.com>,
        "bp@...e.de" <bp@...e.de>,
        "mhiramat@...nel.org" <mhiramat@...nel.org>,
        "krzk@...nel.org" <krzk@...nel.org>,
        "mazziesaccount@...il.com" <mazziesaccount@...il.com>,
        "skhan@...uxfoundation.org" <skhan@...uxfoundation.org>,
        "zaslonko@...ux.ibm.com" <zaslonko@...ux.ibm.com>,
        "Laine, Markus" <Markus.Laine@...rohmeurope.com>,
        "vincenzo.frascino@....com" <vincenzo.frascino@....com>,
        "sre@...nel.org" <sre@...nel.org>,
        "ardb@...nel.org" <ardb@...nel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "uwe@...ine-koenig.org" <uwe@...ine-koenig.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [PATCH v6 09/10] power: supply: Support ROHM bd99954 charger


On Tue, 2020-03-24 at 13:56 +0200, andriy.shevchenko@...ux.intel.com
wrote:
> On Tue, Mar 24, 2020 at 10:53:09AM +0000, Vaittinen, Matti wrote:
> > On Tue, 2020-03-24 at 11:50 +0200, Andy Shevchenko wrote:
> > > On Tue, Mar 24, 2020 at 10:32:19AM +0200, Matti Vaittinen wrote:
> 
> ...
> 
> > > > +	for (i = ffs(tmp); i; i = ffs(tmp)) {
> > > 
> > > NIH of for_each_set_bit().
> > 
> > What does the NIH stand for?
> 
> Not Invented Here syndrome :-)

Ah. I definitely plead guilty for that in general. Or even NIBM (Not
Invented By Me) :] But at this time for_each_set_bit() just didn't come
to my mind - and I used ffs() - even though that's not invented by me
either ;)

I just modified the driver to use for_each_set_bit() and you were
correct. Result is _much_ prettier. Thanks! That'll be fixed in v7.

> ...
> 
> > > > +	if (!dev->platform_data) {
> > > 
> > > dev_get_platdata()
> > > 
> > > > +		ret = bd9995x_fw_probe(bd);
> > > > +		if (ret < 0) {
> > > > +			dev_err(dev, "Cannot read device
> > > > properties.\n");
> > > > +			return ret;
> > > > +		}
> > > > +	} else {
> > > > +		return -ENODEV;
> > > 
> > > So, existing platform data leads to an error?!
> > 
> > Yes. As currently we only use DT. If someone needs platdata they
> > need
> > to improve the driver
> 
> I think the idea to avoid platform data in new code as much as
> possible.
> And it's unusual to have somebody to use this driver with
> platform_data set.
> Why not simple ignore it?

Because if someone _is_ using platform data here (and we still provide
this mechanism) - then we should inform him that he's doing something
which is not correct.

Best Regards
	Matti

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ