diff options
author | Josh Hay <joshua.a.hay@intel.com> | 2013-01-03 22:34:42 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-02-05 04:44:04 -0500 |
commit | d2c47b626ecdd0efa907355fc7eeb34236b3713a (patch) | |
tree | 4bbf440dbb850bd52fed90566d2272bdeab106cd /drivers | |
parent | f752be9c3de4fbb6a9b2c060f3794bd928a0ad7a (diff) |
ixgbe: fix return values and memcpy parameters to eliminate Smatch warnings
This patch removes the rval variable returns from function and replaces
them with direct returns in ixgbe_dcbnl_getnumtcs. It also changes how
ixgbe_gstrings_test is copied into data with memcpy in ixgbe_get_strings
because "*ixgbe_gstrings_test too small (32 vs 160)".
Signed-off-by: Josh Hay <joshua.a.hay@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index c261333438bf..373559010da0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -449,7 +449,6 @@ static u8 ixgbe_dcbnl_getcap(struct net_device *netdev, int capid, u8 *cap) | |||
449 | static int ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num) | 449 | static int ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num) |
450 | { | 450 | { |
451 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 451 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
452 | u8 rval = 0; | ||
453 | 452 | ||
454 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 453 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
455 | switch (tcid) { | 454 | switch (tcid) { |
@@ -460,14 +459,14 @@ static int ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num) | |||
460 | *num = adapter->dcb_cfg.num_tcs.pfc_tcs; | 459 | *num = adapter->dcb_cfg.num_tcs.pfc_tcs; |
461 | break; | 460 | break; |
462 | default: | 461 | default: |
463 | rval = -EINVAL; | 462 | return -EINVAL; |
464 | break; | 463 | break; |
465 | } | 464 | } |
466 | } else { | 465 | } else { |
467 | rval = -EINVAL; | 466 | return -EINVAL; |
468 | } | 467 | } |
469 | 468 | ||
470 | return rval; | 469 | return 0; |
471 | } | 470 | } |
472 | 471 | ||
473 | static int ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num) | 472 | static int ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num) |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index bafd141193af..355ca085ed05 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -1099,8 +1099,10 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
1099 | 1099 | ||
1100 | switch (stringset) { | 1100 | switch (stringset) { |
1101 | case ETH_SS_TEST: | 1101 | case ETH_SS_TEST: |
1102 | memcpy(data, *ixgbe_gstrings_test, | 1102 | for (i = 0; i < IXGBE_TEST_LEN; i++) { |
1103 | IXGBE_TEST_LEN * ETH_GSTRING_LEN); | 1103 | memcpy(data, ixgbe_gstrings_test[i], ETH_GSTRING_LEN); |
1104 | data += ETH_GSTRING_LEN; | ||
1105 | } | ||
1104 | break; | 1106 | break; |
1105 | case ETH_SS_STATS: | 1107 | case ETH_SS_STATS: |
1106 | for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) { | 1108 | for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) { |