From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbcILUpy (ORCPT ); Mon, 12 Sep 2016 16:45:54 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37836 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbcILUpx (ORCPT ); Mon, 12 Sep 2016 16:45:53 -0400 Subject: Re: [PATCH] regulator: da9055: remove null pointer check on array pdata->regulators To: Steve Twiss , Support Opensource , Liam Girdwood , Mark Brown References: <20160908094652.17866-1-colin.king@canonical.com> <6ED8E3B22081A4459DAC7699F3695FB7018CCD949A@SW-EX-MBX02.diasemi.com> Cc: "linux-kernel@vger.kernel.org" From: Colin Ian King Message-ID: <288cd660-b52d-7781-c0eb-87ce1d1b461e@canonical.com> Date: Mon, 12 Sep 2016 21:44:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB7018CCD949A@SW-EX-MBX02.diasemi.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/09/16 17:09, Steve Twiss wrote: > > > > On 08 September 2016 10:47, Colin King wrote: > >> To: Support Opensource; Liam Girdwood; Mark Brown >> Cc: linux-kernel@vger.kernel.org >> Subject: [PATCH] regulator: da9055: remove null pointer check on array pdata->regulators >> >> From: Colin Ian King >> >> 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. >> >> Signed-off-by: Colin Ian King >> --- >> 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.9.3 > > Yes, it's true. > > One my colleagues just pointed out why they had déjà vu. > > May I refer to the answer that was given back in March, > https://patchwork.kernel.org/patch/8679771/ > > Regards, > Steve > > Apologies for the noise. I lost track of my original patch.