[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200831101135.GE8299@kadam>
Date: Mon, 31 Aug 2020 13:11:35 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org,
Marek Behún <marek.behun@....cz>,
netdev@...r.kernel.org
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
Russell King <rmk+kernel@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Marek Behún <marek.behun@....cz>
Subject: Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: return error instead
of lane in .serdes_get_lane
Hi "Marek,
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e3ec1e8ca02b7e6c935bba3f9b6da86c2e57d2eb
config: openrisc-randconfig-m031-20200827 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/net/dsa/mv88e6xxx/serdes.c:428 mv88e6341_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:451 mv88e6390_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:526 mv88e6390x_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
# https://github.com/0day-ci/linux/commit/a63db5e9b7db608109e7a315dfde9e57df682a20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
git checkout a63db5e9b7db608109e7a315dfde9e57df682a20
vim +428 drivers/net/dsa/mv88e6xxx/serdes.c
a63db5e9b7db60 Marek Behún 2020-08-19 414 int mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
^^^^^^^^
d3cf7d8f20b493 Marek Behún 2019-08-26 415 {
d3cf7d8f20b493 Marek Behún 2019-08-26 416 u8 cmode = chip->ports[port].cmode;
d3cf7d8f20b493 Marek Behún 2019-08-26 417
a63db5e9b7db60 Marek Behún 2020-08-19 418 *lane = -1;
5122d4ec9e8053 Vivien Didelot 2019-08-31 419 switch (port) {
5122d4ec9e8053 Vivien Didelot 2019-08-31 420 case 5:
3bbb8867f87d91 Marek Behún 2019-08-26 421 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
d3cf7d8f20b493 Marek Behún 2019-08-26 422 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 423 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 424 *lane = MV88E6341_PORT5_LANE;
5122d4ec9e8053 Vivien Didelot 2019-08-31 425 break;
d3cf7d8f20b493 Marek Behún 2019-08-26 426 }
d3cf7d8f20b493 Marek Behún 2019-08-26 427
a63db5e9b7db60 Marek Behún 2020-08-19 @428 return *lane == -1 ? -ENODEV : 0;
^^^^^^^^^^^
A u8 can't be == -1 #Impossible
d3cf7d8f20b493 Marek Behún 2019-08-26 429 }
d3cf7d8f20b493 Marek Behún 2019-08-26 430
a63db5e9b7db60 Marek Behún 2020-08-19 431 int mv88e6390_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
07ffbd74d1786d Andrew Lunn 2018-08-09 432 {
2d2e1dd29962ce Andrew Lunn 2018-08-09 433 u8 cmode = chip->ports[port].cmode;
07ffbd74d1786d Andrew Lunn 2018-08-09 434
a63db5e9b7db60 Marek Behún 2020-08-19 435 *lane = -1;
07ffbd74d1786d Andrew Lunn 2018-08-09 436 switch (port) {
07ffbd74d1786d Andrew Lunn 2018-08-09 437 case 9:
3bbb8867f87d91 Marek Behún 2019-08-26 438 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
07ffbd74d1786d Andrew Lunn 2018-08-09 439 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 440 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 441 *lane = MV88E6390_PORT9_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 442 break;
07ffbd74d1786d Andrew Lunn 2018-08-09 443 case 10:
3bbb8867f87d91 Marek Behún 2019-08-26 444 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
07ffbd74d1786d Andrew Lunn 2018-08-09 445 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 446 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 447 *lane = MV88E6390_PORT10_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 448 break;
07ffbd74d1786d Andrew Lunn 2018-08-09 449 }
17deaf5cb37a36 Marek Behún 2019-08-26 450
a63db5e9b7db60 Marek Behún 2020-08-19 @451 return *lane == -1 ? -ENODEV : 0;
07ffbd74d1786d Andrew Lunn 2018-08-09 452 }
07ffbd74d1786d Andrew Lunn 2018-08-09 453
a63db5e9b7db60 Marek Behún 2020-08-19 454 int mv88e6390x_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
a8c01c0d941d2f Andrew Lunn 2018-08-09 455 {
5122d4ec9e8053 Vivien Didelot 2019-08-31 456 u8 cmode_port = chip->ports[port].cmode;
5122d4ec9e8053 Vivien Didelot 2019-08-31 457 u8 cmode_port10 = chip->ports[10].cmode;
5122d4ec9e8053 Vivien Didelot 2019-08-31 458 u8 cmode_port9 = chip->ports[9].cmode;
a8c01c0d941d2f Andrew Lunn 2018-08-09 459
a63db5e9b7db60 Marek Behún 2020-08-19 460 *lane = -1;
a8c01c0d941d2f Andrew Lunn 2018-08-09 461 switch (port) {
a8c01c0d941d2f Andrew Lunn 2018-08-09 462 case 2:
3bbb8867f87d91 Marek Behún 2019-08-26 463 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 464 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 465 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
5122d4ec9e8053 Vivien Didelot 2019-08-31 466 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 467 *lane = MV88E6390_PORT9_LANE1;
17deaf5cb37a36 Marek Behún 2019-08-26 468 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 469 case 3:
3bbb8867f87d91 Marek Behún 2019-08-26 470 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 471 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 472 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 473 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 474 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 475 *lane = MV88E6390_PORT9_LANE2;
17deaf5cb37a36 Marek Behún 2019-08-26 476 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 477 case 4:
3bbb8867f87d91 Marek Behún 2019-08-26 478 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 479 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 480 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 481 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 482 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 483 *lane = MV88E6390_PORT9_LANE3;
17deaf5cb37a36 Marek Behún 2019-08-26 484 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 485 case 5:
3bbb8867f87d91 Marek Behún 2019-08-26 486 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 487 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 488 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
5122d4ec9e8053 Vivien Didelot 2019-08-31 489 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 490 *lane = MV88E6390_PORT10_LANE1;
17deaf5cb37a36 Marek Behún 2019-08-26 491 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 492 case 6:
3bbb8867f87d91 Marek Behún 2019-08-26 493 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 494 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 495 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 496 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 497 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 498 *lane = MV88E6390_PORT10_LANE2;
17deaf5cb37a36 Marek Behún 2019-08-26 499 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 500 case 7:
3bbb8867f87d91 Marek Behún 2019-08-26 501 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 502 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 503 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 504 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 505 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 506 *lane = MV88E6390_PORT10_LANE3;
17deaf5cb37a36 Marek Behún 2019-08-26 507 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 508 case 9:
3bbb8867f87d91 Marek Behún 2019-08-26 509 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 510 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 511 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 512 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_XAUI ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 513 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
a63db5e9b7db60 Marek Behún 2020-08-19 514 *lane = MV88E6390_PORT9_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 515 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 516 case 10:
3bbb8867f87d91 Marek Behún 2019-08-26 517 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 518 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 519 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 520 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_XAUI ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 521 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
a63db5e9b7db60 Marek Behún 2020-08-19 522 *lane = MV88E6390_PORT10_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 523 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 524 }
17deaf5cb37a36 Marek Behún 2019-08-26 525
a63db5e9b7db60 Marek Behún 2020-08-19 @526 return *lane == -1 ? -ENODEV : 0;
a8c01c0d941d2f Andrew Lunn 2018-08-09 527 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (28496 bytes)
Powered by blists - more mailing lists