[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170221174045.jsiq3dm6d3kkl5um@sirena.org.uk>
Date: Tue, 21 Feb 2017 09:40:45 -0800
From: Mark Brown <broonie@...nel.org>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc: lgirdwood@...il.com, support.opensource@...semi.com,
linux-kernel@...r.kernel.org,
Peter Senna Tschudin <peter.senna@...il.com>
Subject: Re: [PATCH] regulator: remove unnecessary code
On Mon, Feb 20, 2017 at 11:17:36PM -0600, Gustavo A. R. Silva wrote:
> The name of an array used by itself will always return the array's address.
> So it makes no sense to evaluate it, since the test will always evaluate as
> true.
> - if (pdata && pdata->regulators) {
> + if (pdata) {
This isn't actually helping anything, it just makes the code potentially
less robust if someone changes regulators to be allocated separately.
There's no cost to having the check in the code, the compiler should
notice if it's always true.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists