Messages in this thread | | | Date | Tue, 13 Sep 2016 00:51:42 +0100 | From | Mark Brown <> | Subject | Re: [PATCH] regulator: da9052: remove null pointer check on array pdata->regulators |
| |
On Thu, Sep 08, 2016 at 11:07:36AM +0100, Colin King wrote:
> pdata->regulators is an array of DA9052_MAX_REGULATORS struct > regulator_init_data pointers hence cannot be null, so the null pointer > check on pdata->regulators is redundant. Remove it.
> - if (pdata && pdata->regulators) { > + if (pdata) {
What is the benefit of this change? Due to the way C handles arrays and pointers one can't immediately tell without opening up the header file if regulators is a pointer to an array or an embedded array so it's more work to read and since this is the probe path it's unlikely to be a meaningful speed improvement even if the compiler doesn't figure it out at build time. [unhandled content-type:application/pgp-signature] | |