All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Artur Weber <aweber.kernel@gmail.com>, Lee Jones <lee@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Stanislav Jakubek <stano.jakubek@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Artur Weber <aweber.kernel@gmail.com>
Subject: Re: [PATCH 5/6] regulator: bcm590xx: Add support for BCM59054
Date: Mon, 6 Nov 2023 23:04:56 +0800	[thread overview]
Message-ID: <202311062220.2gWiPqvR-lkp@intel.com> (raw)
In-Reply-To: <20231030-bcm59054-v1-5-3517f980c1e3@gmail.com>

Hi Artur,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1]

url:    https://github.com/intel-lab-lkp/linux/commits/Artur-Weber/dt-bindings-mfd-brcm-bcm59056-Convert-to-YAML/20231031-040046
base:   05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1
patch link:    https://lore.kernel.org/r/20231030-bcm59054-v1-5-3517f980c1e3%40gmail.com
patch subject: [PATCH 5/6] regulator: bcm590xx: Add support for BCM59054
config: powerpc64-allyesconfig (https://download.01.org/0day-ci/archive/20231106/202311062220.2gWiPqvR-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231106/202311062220.2gWiPqvR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311062220.2gWiPqvR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/regulator/bcm590xx-regulator.c:591:13: warning: variable 'n_regulators' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     591 |         } else if (pmu->mfd->device_type == BCM59056_TYPE) {
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:597:6: note: uninitialized use occurs here
     597 |                                  n_regulators,
         |                                  ^~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:591:9: note: remove the 'if' if its condition is always true
     591 |         } else if (pmu->mfd->device_type == BCM59056_TYPE) {
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:577:18: note: initialize the variable 'n_regulators' to silence this warning
     577 |         int n_regulators;
         |                         ^
         |                          = 0
   1 warning generated.


vim +591 drivers/regulator/bcm590xx-regulator.c

   569	
   570	static int bcm590xx_probe(struct platform_device *pdev)
   571	{
   572		struct bcm590xx *bcm590xx = dev_get_drvdata(pdev->dev.parent);
   573		struct bcm590xx_reg *pmu;
   574		struct regulator_config config = { };
   575		struct bcm590xx_info *info;
   576		struct regulator_dev *rdev;
   577		int n_regulators;
   578		int i;
   579	
   580		pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
   581		if (!pmu)
   582			return -ENOMEM;
   583	
   584		pmu->mfd = bcm590xx;
   585	
   586		platform_set_drvdata(pdev, pmu);
   587	
   588		if (pmu->mfd->device_type == BCM59054_TYPE) {
   589			info = bcm59054_regs;
   590			n_regulators = BCM59054_NUM_REGS;
 > 591		} else if (pmu->mfd->device_type == BCM59056_TYPE) {
   592			info = bcm59056_regs;
   593			n_regulators = BCM59056_NUM_REGS;
   594		}
   595	
   596		pmu->desc = devm_kcalloc(&pdev->dev,
   597					 n_regulators,
   598					 sizeof(struct regulator_desc),
   599					 GFP_KERNEL);
   600		if (!pmu->desc)
   601			return -ENOMEM;
   602	
   603		/* Register the regulators */
   604		for (i = 0; i < n_regulators; i++, info++) {
   605			pmu->desc[i].name = info->name;
   606			pmu->desc[i].of_match = of_match_ptr(info->name);
   607			pmu->desc[i].regulators_node = of_match_ptr("regulators");
   608			pmu->desc[i].supply_name = info->vin_name;
   609			pmu->desc[i].id = i;
   610			pmu->desc[i].volt_table = info->volt_table;
   611			pmu->desc[i].n_voltages = info->n_voltages;
   612			pmu->desc[i].linear_ranges = info->linear_ranges;
   613			pmu->desc[i].n_linear_ranges = info->n_linear_ranges;
   614	
   615			if (bcm590xx_reg_is_ldo(pmu, i) || \
   616					bcm590xx_reg_is_gpldo(pmu, i)) {
   617				pmu->desc[i].ops = &bcm590xx_ops_ldo;
   618				pmu->desc[i].vsel_mask = BCM590XX_LDO_VSEL_MASK;
   619			} else if (bcm590xx_reg_is_static(pmu, i)) {
   620				pmu->desc[i].ops = &bcm590xx_ops_static;
   621			} else {
   622				pmu->desc[i].ops = &bcm590xx_ops_dcdc;
   623				pmu->desc[i].vsel_mask = BCM590XX_SR_VSEL_MASK;
   624			}
   625	
   626			if (bcm590xx_reg_is_vbus(pmu, i)) {
   627				pmu->desc[i].enable_mask = BCM590XX_VBUS_ENABLE;
   628			} else {
   629				pmu->desc[i].vsel_reg = \
   630					bcm590xx_get_vsel_register(pmu, i);
   631				pmu->desc[i].enable_mask = \
   632					bcm590xx_get_enable_mask(pmu, i);
   633				pmu->desc[i].enable_is_inverted = true;
   634			}
   635			pmu->desc[i].enable_reg = \
   636				bcm590xx_get_enable_register(pmu, i);
   637			pmu->desc[i].type = REGULATOR_VOLTAGE;
   638			pmu->desc[i].owner = THIS_MODULE;
   639	
   640			config.dev = pmu->mfd->dev;
   641			config.driver_data = pmu;
   642			if (bcm590xx_reg_is_secondary(pmu, i))
   643				config.regmap = pmu->mfd->regmap_sec;
   644			else
   645				config.regmap = pmu->mfd->regmap_pri;
   646	
   647			rdev = devm_regulator_register(&pdev->dev, &pmu->desc[i],
   648						       &config);
   649			if (IS_ERR(rdev)) {
   650				dev_err(bcm590xx->dev,
   651					"failed to register %s regulator\n",
   652					pdev->name);
   653				return PTR_ERR(rdev);
   654			}
   655		}
   656	
   657		return 0;
   658	}
   659	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Artur Weber <aweber.kernel@gmail.com>, Lee Jones <lee@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Stanislav Jakubek <stano.jakubek@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Artur Weber <aweber.kernel@gmail.com>
Subject: Re: [PATCH 5/6] regulator: bcm590xx: Add support for BCM59054
Date: Mon, 6 Nov 2023 23:04:56 +0800	[thread overview]
Message-ID: <202311062220.2gWiPqvR-lkp@intel.com> (raw)
In-Reply-To: <20231030-bcm59054-v1-5-3517f980c1e3@gmail.com>

Hi Artur,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1]

url:    https://github.com/intel-lab-lkp/linux/commits/Artur-Weber/dt-bindings-mfd-brcm-bcm59056-Convert-to-YAML/20231031-040046
base:   05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1
patch link:    https://lore.kernel.org/r/20231030-bcm59054-v1-5-3517f980c1e3%40gmail.com
patch subject: [PATCH 5/6] regulator: bcm590xx: Add support for BCM59054
config: powerpc64-allyesconfig (https://download.01.org/0day-ci/archive/20231106/202311062220.2gWiPqvR-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231106/202311062220.2gWiPqvR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311062220.2gWiPqvR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/regulator/bcm590xx-regulator.c:591:13: warning: variable 'n_regulators' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     591 |         } else if (pmu->mfd->device_type == BCM59056_TYPE) {
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:597:6: note: uninitialized use occurs here
     597 |                                  n_regulators,
         |                                  ^~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:591:9: note: remove the 'if' if its condition is always true
     591 |         } else if (pmu->mfd->device_type == BCM59056_TYPE) {
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/bcm590xx-regulator.c:577:18: note: initialize the variable 'n_regulators' to silence this warning
     577 |         int n_regulators;
         |                         ^
         |                          = 0
   1 warning generated.


vim +591 drivers/regulator/bcm590xx-regulator.c

   569	
   570	static int bcm590xx_probe(struct platform_device *pdev)
   571	{
   572		struct bcm590xx *bcm590xx = dev_get_drvdata(pdev->dev.parent);
   573		struct bcm590xx_reg *pmu;
   574		struct regulator_config config = { };
   575		struct bcm590xx_info *info;
   576		struct regulator_dev *rdev;
   577		int n_regulators;
   578		int i;
   579	
   580		pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
   581		if (!pmu)
   582			return -ENOMEM;
   583	
   584		pmu->mfd = bcm590xx;
   585	
   586		platform_set_drvdata(pdev, pmu);
   587	
   588		if (pmu->mfd->device_type == BCM59054_TYPE) {
   589			info = bcm59054_regs;
   590			n_regulators = BCM59054_NUM_REGS;
 > 591		} else if (pmu->mfd->device_type == BCM59056_TYPE) {
   592			info = bcm59056_regs;
   593			n_regulators = BCM59056_NUM_REGS;
   594		}
   595	
   596		pmu->desc = devm_kcalloc(&pdev->dev,
   597					 n_regulators,
   598					 sizeof(struct regulator_desc),
   599					 GFP_KERNEL);
   600		if (!pmu->desc)
   601			return -ENOMEM;
   602	
   603		/* Register the regulators */
   604		for (i = 0; i < n_regulators; i++, info++) {
   605			pmu->desc[i].name = info->name;
   606			pmu->desc[i].of_match = of_match_ptr(info->name);
   607			pmu->desc[i].regulators_node = of_match_ptr("regulators");
   608			pmu->desc[i].supply_name = info->vin_name;
   609			pmu->desc[i].id = i;
   610			pmu->desc[i].volt_table = info->volt_table;
   611			pmu->desc[i].n_voltages = info->n_voltages;
   612			pmu->desc[i].linear_ranges = info->linear_ranges;
   613			pmu->desc[i].n_linear_ranges = info->n_linear_ranges;
   614	
   615			if (bcm590xx_reg_is_ldo(pmu, i) || \
   616					bcm590xx_reg_is_gpldo(pmu, i)) {
   617				pmu->desc[i].ops = &bcm590xx_ops_ldo;
   618				pmu->desc[i].vsel_mask = BCM590XX_LDO_VSEL_MASK;
   619			} else if (bcm590xx_reg_is_static(pmu, i)) {
   620				pmu->desc[i].ops = &bcm590xx_ops_static;
   621			} else {
   622				pmu->desc[i].ops = &bcm590xx_ops_dcdc;
   623				pmu->desc[i].vsel_mask = BCM590XX_SR_VSEL_MASK;
   624			}
   625	
   626			if (bcm590xx_reg_is_vbus(pmu, i)) {
   627				pmu->desc[i].enable_mask = BCM590XX_VBUS_ENABLE;
   628			} else {
   629				pmu->desc[i].vsel_reg = \
   630					bcm590xx_get_vsel_register(pmu, i);
   631				pmu->desc[i].enable_mask = \
   632					bcm590xx_get_enable_mask(pmu, i);
   633				pmu->desc[i].enable_is_inverted = true;
   634			}
   635			pmu->desc[i].enable_reg = \
   636				bcm590xx_get_enable_register(pmu, i);
   637			pmu->desc[i].type = REGULATOR_VOLTAGE;
   638			pmu->desc[i].owner = THIS_MODULE;
   639	
   640			config.dev = pmu->mfd->dev;
   641			config.driver_data = pmu;
   642			if (bcm590xx_reg_is_secondary(pmu, i))
   643				config.regmap = pmu->mfd->regmap_sec;
   644			else
   645				config.regmap = pmu->mfd->regmap_pri;
   646	
   647			rdev = devm_regulator_register(&pdev->dev, &pmu->desc[i],
   648						       &config);
   649			if (IS_ERR(rdev)) {
   650				dev_err(bcm590xx->dev,
   651					"failed to register %s regulator\n",
   652					pdev->name);
   653				return PTR_ERR(rdev);
   654			}
   655		}
   656	
   657		return 0;
   658	}
   659	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-11-06 15:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 19:36 [PATCH 0/6] mfd: bcm590xx: Add support for BCM59054 Artur Weber
2023-10-30 19:36 ` Artur Weber
2023-10-30 19:36 ` [PATCH 1/6] dt-bindings: mfd: brcm,bcm59056: Convert to YAML Artur Weber
2023-10-30 19:36   ` Artur Weber
2023-10-31  5:52   ` Krzysztof Kozlowski
2023-10-31  5:52     ` Krzysztof Kozlowski
2023-10-31  9:36     ` Artur Weber
2023-10-31  9:36       ` Artur Weber
2023-10-31 13:54       ` Krzysztof Kozlowski
2023-10-31 13:54         ` Krzysztof Kozlowski
2023-10-30 19:36 ` [PATCH 2/6] dt-bindings: mfd: brcm,bcm59056: Add compatible for BCM59054 Artur Weber
2023-10-30 19:36   ` Artur Weber
2023-10-31  5:54   ` Krzysztof Kozlowski
2023-10-31  5:54     ` Krzysztof Kozlowski
2023-10-30 19:36 ` [PATCH 3/6] ARM: dts: Drop DTS for BCM59056 PMIC Artur Weber
2023-10-30 19:36   ` Artur Weber
2023-10-30 19:36 ` [PATCH 4/6] mfd: bcm590xx: Add compatible for BCM59054 Artur Weber
2023-10-30 19:36   ` Artur Weber
2023-10-31  3:38   ` kernel test robot
2023-10-31  3:38     ` kernel test robot
2023-11-06  9:46   ` kernel test robot
2023-11-06  9:46     ` kernel test robot
2023-10-30 19:36 ` [PATCH 5/6] regulator: bcm590xx: Add support " Artur Weber
2023-10-30 19:36   ` Artur Weber
2023-11-06 15:04   ` kernel test robot [this message]
2023-11-06 15:04     ` kernel test robot
2023-10-30 19:36 ` [PATCH 6/6] regulator: bcm590xx: Add proper handling for PMMODE registers Artur Weber
2023-10-30 19:36   ` Artur Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202311062220.2gWiPqvR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aweber.kernel@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=krzk@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=stano.jakubek@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.