tree:
https://github.com/shenki/linux dev-5.8
head: 4580132ac2faa1e58275527f06e99b6b92715fd5
commit: 90ddc4e972b53cb32bdc76a7180ede8b8c3797d2 [102/137] peci: Add support for PECI bus
driver core
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
> drivers/peci/peci-core.c:1295:9: warning: Variable
'status' is reassigned a value before the old one has been used.
[redundantAssignment]
status = dev_pm_domain_attach(&client->dev, true);
^
drivers/peci/peci-core.c:1282:0: note: Variable 'status' is reassigned a value
before the old one has been used.
int status = -EINVAL;
^
drivers/peci/peci-core.c:1295:9: note: Variable 'status' is reassigned a value
before the old one has been used.
status = dev_pm_domain_attach(&client->dev, true);
^
> drivers/peci/peci-core.c:1861:6: warning: Variable 'ret'
is reassigned a value before the old one has been used. [redundantAssignment]
ret = device_add(&adapter->dev);
^
drivers/peci/peci-core.c:1843:0: note: Variable 'ret' is reassigned a value
before the old one has been used.
int ret = -EINVAL;
^
drivers/peci/peci-core.c:1861:6: note: Variable 'ret' is reassigned a value
before the old one has been used.
ret = device_add(&adapter->dev);
^
vim +/status +1295 drivers/peci/peci-core.c
1277
1278 static int peci_device_probe(struct device *dev)
1279 {
1280 struct peci_client *client = peci_verify_client(dev);
1281 struct peci_driver *driver;
1282 int status = -EINVAL;
1283
1284 if (!client)
1285 return 0;
1286
1287 driver = to_peci_driver(dev->driver);
1288
1289 if (!driver->id_table &&
1290 !peci_of_match_device(dev->driver->of_match_table, client))
1291 return -ENODEV;
1292
1293 dev_dbg(dev, "%s: name:%s\n", __func__, client->name);
1294
1295 status = dev_pm_domain_attach(&client->dev, true);
1296 if (status == -EPROBE_DEFER)
1297 return status;
1298
1299 if (driver->probe)
1300 status = driver->probe(client);
1301 else
1302 status = -EINVAL;
1303
1304 if (status)
1305 goto err_detach_pm_domain;
1306
1307 return 0;
1308
1309 err_detach_pm_domain:
1310 dev_pm_domain_detach(&client->dev, true);
1311
1312 return status;
1313 }
1314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org