Re: [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check

From: Charles Keepax
Date: Thu Jul 02 2015 - 06:19:03 EST


On Thu, Jul 02, 2015 at 01:27:09PM +0530, Maninder Singh wrote:
> pdata is used before NULL check, so it looks misleading.
> If pdata validation is required then we have to
> first check for pdata validation, then calculate id,
> and then second check for pdata->dcdc[id].
>
> and it is better to use !pointer than (pointer == NULL)
>
> Signed-off-by: Maninder Singh <maninder1.s@xxxxxxxxxxx>
> ---

The patch basically looks fine, but it feels a bit like needless
churn. The current code is perfectly correct and feels clear
enough to me.

Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/