All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Brad Mouring <brad.mouring@ni.com>
Cc: kbuild-all@01.org, Nicolas Ferre <nicolas.ferre@microchip.com>,
	Rob Herring <robh+dt@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>, Mark Rutland <mark.rutland@arm.com>,
	netdev@vger.kernel.org, Julia Cartwright <julia@ni.com>,
	devicetree@vger.kernel.org, Brad Mouring <brad.mouring@ni.com>
Subject: Re: [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup
Date: Sun, 11 Mar 2018 15:02:22 +0800	[thread overview]
Message-ID: <201803111437.qPxzMeCB%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180309221233.71202-1-brad.mouring@ni.com>

[-- Attachment #1: Type: text/plain, Size: 4174 bytes --]

Hi Brad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Brad-Mouring/net-macb-Reorganize-macb_mii-bringup/20180311-133616
config: i386-randconfig-x012-201810 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/cadence/macb_main.c: In function 'macb_probe':
>> drivers/net/ethernet/cadence/macb_main.c:503:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
        if (ret)
           ^
   drivers/net/ethernet/cadence/macb_main.c:477:6: note: 'ret' was declared here
     int ret, i;
         ^~~

vim +/ret +503 drivers/net/ethernet/cadence/macb_main.c

   468	
   469	/* based on au1000_eth. c*/
   470	static int macb_mii_probe(struct net_device *dev)
   471	{
   472		struct macb *bp = netdev_priv(dev);
   473		struct macb_platform_data *pdata = dev_get_platdata(&bp->pdev->dev);
   474		struct phy_device *phydev;
   475		struct device_node *np = bp->pdev->dev.of_node;
   476		int phy_irq;
   477		int ret, i;
   478	
   479		if (np) {
   480			if (of_phy_is_fixed_link(np)) {
   481				if (of_phy_register_fixed_link(np) < 0) {
   482					dev_err(&bp->pdev->dev,
   483						"broken fixed-link specification\n");
   484					return -ENODEV;
   485				}
   486				bp->phy_node = of_node_get(np);
   487			} else {
   488				/* fallback to standard phy registration if no phy were
   489				 * found during dt phy registration
   490				 */
   491				if (!phy_find_first(bp->mii_bus)) {
   492					for (i = 0; i < PHY_MAX_ADDR; i++) {
   493						struct phy_device *phydev;
   494	
   495						phydev = mdiobus_scan(bp->mii_bus, i);
   496						if (IS_ERR(phydev) &&
   497						    PTR_ERR(phydev) != -ENODEV) {
   498							ret = PTR_ERR(phydev);
   499							break;
   500						}
   501					}
   502	
 > 503					if (ret)
   504						return -ENODEV;
   505				}
   506			}
   507		} else {
   508			for (i = 0; i < PHY_MAX_ADDR; i++)
   509				bp->mii_bus->irq[i] = PHY_POLL;
   510	
   511			if (pdata)
   512				bp->mii_bus->phy_mask = pdata->phy_mask;
   513	
   514		}
   515	
   516		if (bp->phy_node) {
   517			phydev = of_phy_connect(dev, bp->phy_node,
   518						&macb_handle_link_change, 0,
   519						bp->phy_interface);
   520			if (!phydev)
   521				return -ENODEV;
   522		} else {
   523			phydev = phy_find_first(bp->mii_bus);
   524			if (!phydev) {
   525				netdev_err(dev, "no PHY found\n");
   526				return -ENXIO;
   527			}
   528	
   529			if (pdata) {
   530				if (gpio_is_valid(pdata->phy_irq_pin)) {
   531					ret = devm_gpio_request(&bp->pdev->dev,
   532								pdata->phy_irq_pin, "phy int");
   533					if (!ret) {
   534						phy_irq = gpio_to_irq(pdata->phy_irq_pin);
   535						phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
   536					}
   537				} else {
   538					phydev->irq = PHY_POLL;
   539				}
   540			}
   541	
   542			/* attach the mac to the phy */
   543			ret = phy_connect_direct(dev, phydev, &macb_handle_link_change,
   544						 bp->phy_interface);
   545			if (ret) {
   546				netdev_err(dev, "Could not attach to PHY\n");
   547				return ret;
   548			}
   549		}
   550	
   551		/* mask with MAC supported features */
   552		if (macb_is_gem(bp) && bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE)
   553			phydev->supported &= PHY_GBIT_FEATURES;
   554		else
   555			phydev->supported &= PHY_BASIC_FEATURES;
   556	
   557		if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)
   558			phydev->supported &= ~SUPPORTED_1000baseT_Half;
   559	
   560		phydev->advertising = phydev->supported;
   561	
   562		bp->link = 0;
   563		bp->speed = 0;
   564		bp->duplex = -1;
   565	
   566		return 0;
   567	}
   568	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34070 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Brad Mouring <brad.mouring@ni.com>
Cc: kbuild-all@01.org, Nicolas Ferre <nicolas.ferre@microchip.com>,
	Rob Herring <robh+dt@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>, Mark Rutland <mark.rutland@arm.com>,
	netdev@vger.kernel.org, Julia Cartwright <julia@ni.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup
Date: Sun, 11 Mar 2018 15:02:22 +0800	[thread overview]
Message-ID: <201803111437.qPxzMeCB%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180309221233.71202-1-brad.mouring@ni.com>

[-- Attachment #1: Type: text/plain, Size: 4174 bytes --]

Hi Brad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Brad-Mouring/net-macb-Reorganize-macb_mii-bringup/20180311-133616
config: i386-randconfig-x012-201810 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/cadence/macb_main.c: In function 'macb_probe':
>> drivers/net/ethernet/cadence/macb_main.c:503:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
        if (ret)
           ^
   drivers/net/ethernet/cadence/macb_main.c:477:6: note: 'ret' was declared here
     int ret, i;
         ^~~

vim +/ret +503 drivers/net/ethernet/cadence/macb_main.c

   468	
   469	/* based on au1000_eth. c*/
   470	static int macb_mii_probe(struct net_device *dev)
   471	{
   472		struct macb *bp = netdev_priv(dev);
   473		struct macb_platform_data *pdata = dev_get_platdata(&bp->pdev->dev);
   474		struct phy_device *phydev;
   475		struct device_node *np = bp->pdev->dev.of_node;
   476		int phy_irq;
   477		int ret, i;
   478	
   479		if (np) {
   480			if (of_phy_is_fixed_link(np)) {
   481				if (of_phy_register_fixed_link(np) < 0) {
   482					dev_err(&bp->pdev->dev,
   483						"broken fixed-link specification\n");
   484					return -ENODEV;
   485				}
   486				bp->phy_node = of_node_get(np);
   487			} else {
   488				/* fallback to standard phy registration if no phy were
   489				 * found during dt phy registration
   490				 */
   491				if (!phy_find_first(bp->mii_bus)) {
   492					for (i = 0; i < PHY_MAX_ADDR; i++) {
   493						struct phy_device *phydev;
   494	
   495						phydev = mdiobus_scan(bp->mii_bus, i);
   496						if (IS_ERR(phydev) &&
   497						    PTR_ERR(phydev) != -ENODEV) {
   498							ret = PTR_ERR(phydev);
   499							break;
   500						}
   501					}
   502	
 > 503					if (ret)
   504						return -ENODEV;
   505				}
   506			}
   507		} else {
   508			for (i = 0; i < PHY_MAX_ADDR; i++)
   509				bp->mii_bus->irq[i] = PHY_POLL;
   510	
   511			if (pdata)
   512				bp->mii_bus->phy_mask = pdata->phy_mask;
   513	
   514		}
   515	
   516		if (bp->phy_node) {
   517			phydev = of_phy_connect(dev, bp->phy_node,
   518						&macb_handle_link_change, 0,
   519						bp->phy_interface);
   520			if (!phydev)
   521				return -ENODEV;
   522		} else {
   523			phydev = phy_find_first(bp->mii_bus);
   524			if (!phydev) {
   525				netdev_err(dev, "no PHY found\n");
   526				return -ENXIO;
   527			}
   528	
   529			if (pdata) {
   530				if (gpio_is_valid(pdata->phy_irq_pin)) {
   531					ret = devm_gpio_request(&bp->pdev->dev,
   532								pdata->phy_irq_pin, "phy int");
   533					if (!ret) {
   534						phy_irq = gpio_to_irq(pdata->phy_irq_pin);
   535						phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
   536					}
   537				} else {
   538					phydev->irq = PHY_POLL;
   539				}
   540			}
   541	
   542			/* attach the mac to the phy */
   543			ret = phy_connect_direct(dev, phydev, &macb_handle_link_change,
   544						 bp->phy_interface);
   545			if (ret) {
   546				netdev_err(dev, "Could not attach to PHY\n");
   547				return ret;
   548			}
   549		}
   550	
   551		/* mask with MAC supported features */
   552		if (macb_is_gem(bp) && bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE)
   553			phydev->supported &= PHY_GBIT_FEATURES;
   554		else
   555			phydev->supported &= PHY_BASIC_FEATURES;
   556	
   557		if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)
   558			phydev->supported &= ~SUPPORTED_1000baseT_Half;
   559	
   560		phydev->advertising = phydev->supported;
   561	
   562		bp->link = 0;
   563		bp->speed = 0;
   564		bp->duplex = -1;
   565	
   566		return 0;
   567	}
   568	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34070 bytes --]

  parent reply	other threads:[~2018-03-11  7:02 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 22:42 [PATCH 1/2] net: macb: Add phy-handle DT support Brad Mouring
2018-03-07 22:42 ` Brad Mouring
2018-03-07 22:42 ` [PATCH 2/2] Documentation: macb: Document phy-handle optional binding Brad Mouring
2018-03-07 22:42   ` Brad Mouring
2018-03-08 17:32 ` [1/2] net: macb: Add phy-handle DT support Andrew Lunn
2018-03-08 22:00   ` Brad Mouring
2018-03-08 22:00     ` Brad Mouring
2018-03-09 22:12   ` [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup Brad Mouring
2018-03-09 22:12     ` Brad Mouring
2018-03-09 22:12     ` [PATCH v2 net-next 2/3] net: macb: Add phy-handle DT support Brad Mouring
2018-03-09 22:12       ` Brad Mouring
2018-03-09 22:12     ` [PATCH v2 net-next 3/3] Documentation: macb: Document phy-handle optional binding Brad Mouring
2018-03-09 22:12       ` Brad Mouring
2018-03-10 16:18       ` Andrew Lunn
2018-03-10 16:17     ` [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup Andrew Lunn
2018-03-10 22:19       ` Brad Mouring
2018-03-10 22:19         ` Brad Mouring
2018-03-12 17:09       ` [PATCH v3 net-next 0/4] macb: Introduce phy-handle DT functionality Brad Mouring
2018-03-12 17:09         ` [PATCH v3 net-next 1/4] net: macb: Reorganize macb_mii bringup Brad Mouring
2018-03-12 17:09           ` Brad Mouring
2018-03-12 17:17           ` Florian Fainelli
2018-03-13  4:25           ` kbuild test robot
2018-03-13  4:25             ` kbuild test robot
2018-03-12 17:09         ` [PATCH v3 net-next 2/4] net: macb: Remove redundant poll irq assignment Brad Mouring
2018-03-12 17:09           ` Brad Mouring
2018-03-12 17:17           ` Florian Fainelli
2018-03-12 17:10         ` [PATCH v3 net-next 3/4] net: macb: Add phy-handle DT support Brad Mouring
2018-03-12 17:10           ` Brad Mouring
2018-03-12 17:59           ` Andrew Lunn
2018-03-12 21:34             ` [PATCH v4 net-next 0/4] Brad Mouring
2018-03-12 21:34               ` [PATCH v4 net-next 1/4] net: macb: Reorganize macb_mii bringup Brad Mouring
2018-03-12 21:34                 ` Brad Mouring
2018-03-12 21:34               ` [PATCH v4 net-next 2/4] net: macb: Remove redundant poll irq assignment Brad Mouring
2018-03-12 21:34                 ` Brad Mouring
2018-03-12 21:34               ` [PATCH v4 net-next 3/4] net: macb: Add phy-handle DT support Brad Mouring
2018-03-12 21:34                 ` Brad Mouring
2018-03-12 21:57                 ` Andrew Lunn
2018-03-12 22:30                   ` Florian Fainelli
2018-03-13 13:49                     ` Brad Mouring
2018-03-13 13:49                       ` Brad Mouring
2018-03-13 21:32                     ` [PATCH v5 net-next 0/4] net: macb: Introduce phy-handle DT functionality Brad Mouring
2018-03-13 21:32                       ` Brad Mouring
2018-03-13 21:32                       ` [PATCH v5 net-next 1/4] net: macb: Reorganize macb_mii bringup Brad Mouring
2018-03-13 21:32                         ` Brad Mouring
2018-03-13 21:32                       ` [PATCH v5 net-next 2/4] net: macb: Remove redundant poll irq assignment Brad Mouring
2018-03-13 21:32                         ` Brad Mouring
2018-03-13 21:32                       ` [PATCH v5 net-next 3/4] net: macb: Add phy-handle DT support Brad Mouring
2018-03-13 21:32                         ` Brad Mouring
2018-03-13 21:32                       ` [PATCH v5 net-next 4/4] Documentation: macb: Document phy-handle binding Brad Mouring
2018-03-13 21:32                         ` Brad Mouring
2018-03-16 15:15                       ` [PATCH v5 net-next 0/4] net: macb: Introduce phy-handle DT functionality David Miller
2018-03-12 21:34               ` [PATCH v4 net-next 4/4] Documentation: macb: Document phy-handle binding Brad Mouring
2018-03-12 21:34                 ` Brad Mouring
2018-03-12 17:10         ` [PATCH v3 " Brad Mouring
2018-03-12 17:10           ` Brad Mouring
2018-03-12 17:18           ` Florian Fainelli
2018-03-11  7:02     ` kbuild test robot [this message]
2018-03-11  7:02       ` [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201803111437.qPxzMeCB%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=brad.mouring@ni.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=julia@ni.com \
    --cc=kbuild-all@01.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.