Content-Type: multipart/mixed; boundary="===============2623792844974198886==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v4 1/2] leds: ktd20xx: Extension of the KTD20xx family of LED drivers from Kinetic Date: Tue, 25 Jan 2022 11:48:23 +0800 Message-ID: <202201251140.YNV7J1Ot-lkp@intel.com> In-Reply-To: <20220121140150.1729-2-fe@dev.tdt.de> List-Id: --===============2623792844974198886== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Florian, I love your patch! Perhaps something to improve: [auto build test WARNING on pavel-leds/for-next] [also build test WARNING on robh/for-next linux/master linus/master v5.17-r= c1 next-20220124] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Florian-Eckert/leds-add-kt= d20xx-LED-driver-support/20220121-220338 base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git = for-next config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220125= /202201251140.YNV7J1Ot-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a1= 8910867ba6795066e044293e6daf89edf5) reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/8e24c9cc5b5a807f40eec9cc6= 43c2ea43f75e8a3 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Florian-Eckert/leds-add-ktd20xx-LE= D-driver-support/20220121-220338 git checkout 8e24c9cc5b5a807f40eec9cc643c2ea43f75e8a3 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash arch/x86/kvm/ drivers/leds/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/leds/leds-ktd20xx.c:490:6: warning: variable 'ret' is used unini= tialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (IS_ERR(chip->regmap)) { ^~~~~~~~~~~~~~~~~~~~ drivers/leds/leds-ktd20xx.c:542:9: note: uninitialized use occurs here return ret; ^~~ drivers/leds/leds-ktd20xx.c:490:2: note: remove the 'if' if its conditio= n is always false if (IS_ERR(chip->regmap)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/leds-ktd20xx.c:478:9: note: initialize the variable 'ret' t= o silence this warning int ret; ^ =3D 0 1 warning generated. vim +490 drivers/leds/leds-ktd20xx.c 469 = 470 static int ktd20xx_probe(struct i2c_client *client, 471 const struct i2c_device_id *id) 472 { 473 struct ktd20xx *chip; 474 unsigned int vendor; 475 unsigned int chip_id; 476 unsigned int chip_rev; 477 struct device *dev; 478 int ret; 479 = 480 chip =3D devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 481 if (!chip) 482 return -ENOMEM; 483 = 484 mutex_init(&chip->lock); 485 chip->client =3D client; 486 dev =3D &client->dev; 487 i2c_set_clientdata(client, chip); 488 = 489 chip->regmap =3D devm_regmap_init_i2c(client, &ktd20xx_regmap_confi= g); > 490 if (IS_ERR(chip->regmap)) { 491 dev_err_probe(dev, PTR_ERR(chip->regmap), 492 "Failed to allocate register map\n"); 493 goto error; 494 } 495 = 496 chip->control_mode =3D devm_regmap_field_alloc(dev, chip->regmap, 497 kt20xx_control_mode); 498 chip->faderate =3D devm_regmap_field_alloc(dev, chip->regmap, 499 kt20xx_faderate); 500 chip->vendor =3D devm_regmap_field_alloc(dev, chip->regmap, 501 kt20xx_vendor); 502 chip->chip_id =3D devm_regmap_field_alloc(dev, chip->regmap, 503 kt20xx_chip_id); 504 chip->chip_rev =3D devm_regmap_field_alloc(dev, chip->regmap, 505 kt20xx_chip_rev); 506 = 507 /* Reset all registers to hardware device default settings */ 508 regmap_field_write(chip->control_mode, CONTROL_MODE_RESET); 509 = 510 ret =3D regmap_field_read(chip->vendor, &vendor); 511 if (ret) { 512 dev_err_probe(dev, ret, "Failed to read vendor\n"); 513 goto error; 514 } 515 = 516 ret =3D regmap_field_read(chip->chip_id, &chip_id); 517 if (ret) { 518 dev_err_probe(dev, ret, "Failed to read chip id\n"); 519 goto error; 520 } 521 = 522 ret =3D regmap_field_read(chip->chip_rev, &chip_rev); 523 if (ret) { 524 dev_err_probe(dev, ret, "Failed to read chip rev\n"); 525 goto error; 526 } 527 = 528 dev_info(dev, "vendor: 0x%02x chip-id: 0x%02x chip-rev: 0x%02x\n", 529 vendor, chip_id, chip_rev); 530 = 531 ret =3D ktd20xx_probe_dt(chip); 532 if (ret) 533 goto error; 534 = 535 ret =3D ktd20xx_hwinit(chip); 536 if (ret) 537 goto error; 538 = 539 return 0; 540 = 541 error: 542 return ret; 543 } 544 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============2623792844974198886==--