All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: remove unnecessary code
@ 2017-02-21  5:17 Gustavo A. R. Silva
  2017-02-21 17:40 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-02-21  5:17 UTC (permalink / raw)
  To: lgirdwood, broonie, support.opensource
  Cc: linux-kernel, Gustavo A. R. Silva, Peter Senna Tschudin

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.

Addresses-Coverity-ID: 751412
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/regulator/da9055-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
index d029c94..a118f63 100644
--- a/drivers/regulator/da9055-regulator.c
+++ b/drivers/regulator/da9055-regulator.c
@@ -612,7 +612,7 @@ static int da9055_regulator_probe(struct platform_device *pdev)
 	config.driver_data = regulator;
 	config.regmap = da9055->regmap;
 
-	if (pdata && pdata->regulators) {
+	if (pdata) {
 		config.init_data = pdata->regulators[pdev->id];
 	} else {
 		ret = da9055_regulator_dt_init(pdev, regulator, &config,
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-21 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-21  5:17 [PATCH] regulator: remove unnecessary code Gustavo A. R. Silva
2017-02-21 17:40 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.