lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202212261837.VkQWIsNu-lkp@intel.com>
Date:   Mon, 26 Dec 2022 18:11:15 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jerome Neanne <jneanne@...libre.com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Lee Jones <lee@...nel.org>,
        Markus Schneider-Pargmann <msp@...libre.com>
Subject: drivers/regulator/tps65219-regulator.c:370:26: sparse: sparse:
 incompatible types for operation (<):

Hi Jerome,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1b929c02afd37871d5afb9d498426f83432e71c2
commit: 74c17a0a49a6ad3b32cb130f25196d1f8d5d560e mfd: tps65219: Add driver for TI TPS65219 PMIC
date:   3 weeks ago
config: riscv-randconfig-s041-20221226
compiler: riscv64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=74c17a0a49a6ad3b32cb130f25196d1f8d5d560e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 74c17a0a49a6ad3b32cb130f25196d1f8d5d560e
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/regulator/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zihintpause'
>> drivers/regulator/tps65219-regulator.c:370:26: sparse: sparse: incompatible types for operation (<):
>> drivers/regulator/tps65219-regulator.c:370:26: sparse:    struct regulator_dev *[assigned] rdev
>> drivers/regulator/tps65219-regulator.c:370:26: sparse:    int

vim +370 drivers/regulator/tps65219-regulator.c

c12ac5fc3e0af2 Jerome Neanne 2022-08-05  322  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  323  static int tps65219_regulator_probe(struct platform_device *pdev)
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  324  {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  325  	struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  326  	struct regulator_dev *rdev;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  327  	struct regulator_config config = { };
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  328  	int i;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  329  	int error;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  330  	int irq;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  331  	struct tps65219_regulator_irq_data *irq_data;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  332  	struct tps65219_regulator_irq_type *irq_type;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  333  	struct regulator_dev *rdevtbl[7];
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  334  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  335  	config.dev = tps->dev;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  336  	config.driver_data = tps;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  337  	config.regmap = tps->regmap;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  338  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  339  	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  340  		dev_dbg(tps->dev, "%s regul i= %d START", __func__, i);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  341  		rdev = devm_regulator_register(&pdev->dev, &regulators[i],
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  342  					       &config);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  343  		if (IS_ERR(rdev)) {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  344  			dev_err(tps->dev, "failed to register %s regulator\n",
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  345  				pdev->name);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  346  			return PTR_ERR(rdev);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  347  		}
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  348  		rdevtbl[i] = rdev;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  349  		dev_dbg(tps->dev, "%s regul i= %d COMPLETED", __func__, i);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  350  	}
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  351  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  352  	irq_data = devm_kmalloc(tps->dev,
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  353  				ARRAY_SIZE(tps65219_regulator_irq_types) *
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  354  				sizeof(struct tps65219_regulator_irq_data),
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  355  				GFP_KERNEL);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  356  	if (!irq_data)
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  357  		return -ENOMEM;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  358  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  359  	for (i = 0; i < ARRAY_SIZE(tps65219_regulator_irq_types); ++i) {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  360  		irq_type = &tps65219_regulator_irq_types[i];
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  361  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  362  		irq = platform_get_irq_byname(pdev, irq_type->irq_name);
d46f737208a45d Yang Li       2022-08-25  363  		if (irq < 0)
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  364  			return -EINVAL;
d46f737208a45d Yang Li       2022-08-25  365  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  366  		irq_data[i].dev = tps->dev;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  367  		irq_data[i].type = irq_type;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  368  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  369  		tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05 @370  		if (rdev < 0) {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  371  			dev_err(tps->dev, "Failed to get rdev for %s\n",
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  372  				irq_type->regulator_name);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  373  			return -EINVAL;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  374  		}
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  375  		irq_data[i].rdev = rdev;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  376  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  377  		error = devm_request_threaded_irq(tps->dev, irq, NULL,
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  378  						  tps65219_regulator_irq_handler,
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  379  						  IRQF_ONESHOT,
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  380  						  irq_type->irq_name,
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  381  						  &irq_data[i]);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  382  		if (error) {
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  383  			dev_err(tps->dev, "failed to request %s IRQ %d: %d\n",
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  384  				irq_type->irq_name, irq, error);
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  385  			return error;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  386  		}
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  387  	}
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  388  
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  389  	return 0;
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  390  }
c12ac5fc3e0af2 Jerome Neanne 2022-08-05  391  

:::::: The code at line 370 was first introduced by commit
:::::: c12ac5fc3e0af29851785e557e243663b4fc7f4b regulator: drivers: Add TI TPS65219 PMIC regulators support

:::::: TO: Jerome Neanne <jneanne@...libre.com>
:::::: CC: Mark Brown <broonie@...nel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (142341 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ