linux_old1/drivers/net/ethernet/cadence
Soren Brinkmann 9319e47c18 net: macb: Fix build warning
When adjusting the link speed, the target frequency is determined by a
'swith (LINK_SPEED)' statement, that assigns the target rate only for
valid and expected LINK_SPEED values. This incomplete switch statement
leads to the following build warning:
     drivers/net/ethernet/cadence/macb.c: In function 'macb_handle_link_change':
  >> drivers/net/ethernet/cadence/macb.c:241:14: warning: 'rate' may be used uninitialized in this function [-Wmaybe-uninitialized]
        netdev_warn(dev, "unable to generate target frequency: %ld Hz\n",
                   ^
     drivers/net/ethernet/cadence/macb.c:215:13: note: 'rate' was declared here
       long ferr, rate, rate_rounded;

Fixing this by bailing out of that function in the switch's default case
before the rate variable is used.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-11 00:19:17 -05:00
..
Kconfig Remove GENERIC_HARDIRQ config option 2013-09-13 15:09:52 +02:00
Makefile net/at91_ether: select MACB in Kconfig 2012-10-23 02:40:09 -04:00
at91_ether.c net: at91_ether: use dev_get_platdata() 2013-08-30 17:43:39 -04:00
macb.c net: macb: Fix build warning 2013-12-11 00:19:17 -05:00
macb.h net: macb: Adjust tx_clk when link speed changes 2013-12-10 22:56:23 -05:00