tree: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next head: e1ed82f0d145e789ec4cb33aa6442bba2de7df68 commit: f1c525a0ad161617d66dd03dcb4fec7a1e305010 [1/3] i2c: don't print error when adding adapter fails config: x86_64-randconfig-x012-201634 (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: git checkout f1c525a0ad161617d66dd03dcb4fec7a1e305010 # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_probe': >> drivers/i2c/busses/i2c-ocores.c:485:3: error: label 'err_clk' used but not defined goto err_clk; ^~~~ >> drivers/i2c/busses/i2c-ocores.c:418:6: warning: unused variable 'i' [-Wunused-variable] int i; ^ drivers/i2c/busses/i2c-ocores.c: At top level: >> drivers/i2c/busses/i2c-ocores.c:498:2: error: expected identifier or '(' before 'if' if (ret) ^~ drivers/i2c/busses/i2c-ocores.c:502:2: error: expected identifier or '(' before 'if' if (pdata) { ^~ >> drivers/i2c/busses/i2c-ocores.c:507:2: error: expected identifier or '(' before 'return' return 0; ^~~~~~ >> drivers/i2c/busses/i2c-ocores.c:509:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token err_clk: ^ drivers/i2c/busses/i2c-ocores.c:511:2: error: expected identifier or '(' before 'return' return ret; ^~~~~~ >> drivers/i2c/busses/i2c-ocores.c:512:1: error: expected identifier or '(' before '}' token } ^ drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_probe': >> drivers/i2c/busses/i2c-ocores.c:497:2: warning: control reaches end of non-void function [-Wreturn-type] } ^ vim +/err_clk +485 drivers/i2c/busses/i2c-ocores.c 18f98b1e3 Peter Korsgaard 2006-06-04 412 { 18f98b1e3 Peter Korsgaard 2006-06-04 413 struct ocores_i2c *i2c; 18f98b1e3 Peter Korsgaard 2006-06-04 414 struct ocores_i2c_platform_data *pdata; f5f35a92e Andreas Larsson 2012-11-15 415 struct resource *res; f5f35a92e Andreas Larsson 2012-11-15 416 int irq; 18f98b1e3 Peter Korsgaard 2006-06-04 417 int ret; dd14be4c2 Richard Röjfors 2009-06-05 @418 int i; 18f98b1e3 Peter Korsgaard 2006-06-04 419 f5f35a92e Andreas Larsson 2012-11-15 420 irq = platform_get_irq(pdev, 0); f5f35a92e Andreas Larsson 2012-11-15 421 if (irq < 0) f5f35a92e Andreas Larsson 2012-11-15 422 return irq; 18f98b1e3 Peter Korsgaard 2006-06-04 423 47def5b80 Jonas Bonn 2010-11-24 424 i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); 18f98b1e3 Peter Korsgaard 2006-06-04 425 if (!i2c) 18f98b1e3 Peter Korsgaard 2006-06-04 426 return -ENOMEM; 18f98b1e3 Peter Korsgaard 2006-06-04 427 b7d12a866 Julia Lawall 2013-08-14 428 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 84dbf809f Thierry Reding 2013-01-21 429 i2c->base = devm_ioremap_resource(&pdev->dev, res); 84dbf809f Thierry Reding 2013-01-21 430 if (IS_ERR(i2c->base)) 84dbf809f Thierry Reding 2013-01-21 431 return PTR_ERR(i2c->base); 18f98b1e3 Peter Korsgaard 2006-06-04 432 6d4028c64 Jingoo Han 2013-07-30 433 pdata = dev_get_platdata(&pdev->dev); 049bb69d8 Jonas Bonn 2010-11-24 434 if (pdata) { 8bb986a81 Ganesan Ramalingam 2012-07-13 435 i2c->reg_shift = pdata->reg_shift; 7326e38ff Ganesan Ramalingam 2012-07-13 436 i2c->reg_io_width = pdata->reg_io_width; 3a33a8540 Max Filippov 2015-02-02 437 i2c->ip_clock_khz = pdata->clock_khz; 3a33a8540 Max Filippov 2015-02-02 438 i2c->bus_clock_khz = 100; 049bb69d8 Jonas Bonn 2010-11-24 439 } else { 049bb69d8 Jonas Bonn 2010-11-24 440 ret = ocores_i2c_of_probe(pdev, i2c); 049bb69d8 Jonas Bonn 2010-11-24 441 if (ret) 049bb69d8 Jonas Bonn 2010-11-24 442 return ret; 049bb69d8 Jonas Bonn 2010-11-24 443 } 049bb69d8 Jonas Bonn 2010-11-24 444 7326e38ff Ganesan Ramalingam 2012-07-13 445 if (i2c->reg_io_width == 0) 7326e38ff Ganesan Ramalingam 2012-07-13 446 i2c->reg_io_width = 1; /* Set to default value */ 7326e38ff Ganesan Ramalingam 2012-07-13 447 a000b8c1e Andreas Larsson 2012-11-15 448 if (!i2c->setreg || !i2c->getreg) { b29916765 Max Filippov 2015-10-07 449 bool be = pdata ? pdata->big_endian : b29916765 Max Filippov 2015-10-07 450 of_device_is_big_endian(pdev->dev.of_node); b29916765 Max Filippov 2015-10-07 451 a000b8c1e Andreas Larsson 2012-11-15 452 switch (i2c->reg_io_width) { a000b8c1e Andreas Larsson 2012-11-15 453 case 1: a000b8c1e Andreas Larsson 2012-11-15 454 i2c->setreg = oc_setreg_8; a000b8c1e Andreas Larsson 2012-11-15 455 i2c->getreg = oc_getreg_8; a000b8c1e Andreas Larsson 2012-11-15 456 break; a000b8c1e Andreas Larsson 2012-11-15 457 a000b8c1e Andreas Larsson 2012-11-15 458 case 2: b29916765 Max Filippov 2015-10-07 459 i2c->setreg = be ? oc_setreg_16be : oc_setreg_16; b29916765 Max Filippov 2015-10-07 460 i2c->getreg = be ? oc_getreg_16be : oc_getreg_16; a000b8c1e Andreas Larsson 2012-11-15 461 break; a000b8c1e Andreas Larsson 2012-11-15 462 a000b8c1e Andreas Larsson 2012-11-15 463 case 4: b29916765 Max Filippov 2015-10-07 464 i2c->setreg = be ? oc_setreg_32be : oc_setreg_32; b29916765 Max Filippov 2015-10-07 465 i2c->getreg = be ? oc_getreg_32be : oc_getreg_32; a000b8c1e Andreas Larsson 2012-11-15 466 break; a000b8c1e Andreas Larsson 2012-11-15 467 a000b8c1e Andreas Larsson 2012-11-15 468 default: a000b8c1e Andreas Larsson 2012-11-15 469 dev_err(&pdev->dev, "Unsupported I/O width (%d)\n", a000b8c1e Andreas Larsson 2012-11-15 470 i2c->reg_io_width); 97ccd4af1 Alexey Khoroshilov 2016-08-04 471 ret = -EINVAL; 97ccd4af1 Alexey Khoroshilov 2016-08-04 472 goto err_clk; a000b8c1e Andreas Larsson 2012-11-15 473 } a000b8c1e Andreas Larsson 2012-11-15 474 } a000b8c1e Andreas Larsson 2012-11-15 475 3a33a8540 Max Filippov 2015-02-02 476 ret = ocores_init(&pdev->dev, i2c); 3a33a8540 Max Filippov 2015-02-02 477 if (ret) 97ccd4af1 Alexey Khoroshilov 2016-08-04 478 goto err_clk; 18f98b1e3 Peter Korsgaard 2006-06-04 479 18f98b1e3 Peter Korsgaard 2006-06-04 480 init_waitqueue_head(&i2c->wait); f5f35a92e Andreas Larsson 2012-11-15 481 ret = devm_request_irq(&pdev->dev, irq, ocores_isr, 0, 47def5b80 Jonas Bonn 2010-11-24 482 pdev->name, i2c); 18f98b1e3 Peter Korsgaard 2006-06-04 483 if (ret) { 18f98b1e3 Peter Korsgaard 2006-06-04 484 dev_err(&pdev->dev, "Cannot claim IRQ\n"); 97ccd4af1 Alexey Khoroshilov 2016-08-04 @485 goto err_clk; 18f98b1e3 Peter Korsgaard 2006-06-04 486 } 18f98b1e3 Peter Korsgaard 2006-06-04 487 18f98b1e3 Peter Korsgaard 2006-06-04 488 /* hook up driver to tree */ 18f98b1e3 Peter Korsgaard 2006-06-04 489 platform_set_drvdata(pdev, i2c); 18f98b1e3 Peter Korsgaard 2006-06-04 490 i2c->adap = ocores_adapter; 18f98b1e3 Peter Korsgaard 2006-06-04 491 i2c_set_adapdata(&i2c->adap, i2c); 18f98b1e3 Peter Korsgaard 2006-06-04 492 i2c->adap.dev.parent = &pdev->dev; 049bb69d8 Jonas Bonn 2010-11-24 493 i2c->adap.dev.of_node = pdev->dev.of_node; 18f98b1e3 Peter Korsgaard 2006-06-04 494 18f98b1e3 Peter Korsgaard 2006-06-04 495 /* add i2c adapter to i2c tree */ 18f98b1e3 Peter Korsgaard 2006-06-04 496 ret = i2c_add_adapter(&i2c->adap); 18f98b1e3 Peter Korsgaard 2006-06-04 @497 } f1c525a0a Wolfram Sang 2016-08-09 @498 if (ret) f1c525a0a Wolfram Sang 2016-08-09 499 goto err_clk; 18f98b1e3 Peter Korsgaard 2006-06-04 500 dd14be4c2 Richard Röjfors 2009-06-05 501 /* add in known devices to the bus */ 049bb69d8 Jonas Bonn 2010-11-24 502 if (pdata) { dd14be4c2 Richard Röjfors 2009-06-05 503 for (i = 0; i < pdata->num_devices; i++) dd14be4c2 Richard Röjfors 2009-06-05 504 i2c_new_device(&i2c->adap, pdata->devices + i); 049bb69d8 Jonas Bonn 2010-11-24 505 } dd14be4c2 Richard Röjfors 2009-06-05 506 18f98b1e3 Peter Korsgaard 2006-06-04 @507 return 0; 97ccd4af1 Alexey Khoroshilov 2016-08-04 508 97ccd4af1 Alexey Khoroshilov 2016-08-04 @509 err_clk: 97ccd4af1 Alexey Khoroshilov 2016-08-04 510 clk_disable_unprepare(i2c->clk); 97ccd4af1 Alexey Khoroshilov 2016-08-04 @511 return ret; 18f98b1e3 Peter Korsgaard 2006-06-04 @512 } 18f98b1e3 Peter Korsgaard 2006-06-04 513 0b255e927 Bill Pemberton 2012-11-27 514 static int ocores_i2c_remove(struct platform_device *pdev) 18f98b1e3 Peter Korsgaard 2006-06-04 515 { :::::: The code at line 485 was first introduced by commit :::::: 97ccd4af120c6ee183f424f17672870809bd6efd i2c: ocores: add missed clk_disable_unprepare() on failure paths :::::: TO: Alexey Khoroshilov <khoroshilov@xxxxxxxxx> :::::: CC: Wolfram Sang <wsa@xxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data