diff options
author | Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com> | 2016-06-28 02:10:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-29 07:53:35 -0400 |
commit | d2890dea2984749f59bfeffaff7add9030326542 (patch) | |
tree | d35a53b16913e9a1550e217a3d60c8ada7433556 | |
parent | 51d99880879c8911ebcab1ec77ca7da2f4cb470d (diff) |
qede: Fix the static checker warnings.
Static checker warnings:
drivers/net/ethernet/qlogic/qede/qede_ethtool.c:435 qede_get_coalesce()
warn: passing casted pointer '&coal->rx_coalesce_usecs' to
'edev->ops->common->get_coalesce()' 32 vs 16.
The u32 pointer is being typecasted to u16 which may fail for big-endian
platforms.
Fixes: d552fa84cb35 ("qede: Add support for coalescing config read/update.")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c index 6228482bf7f0..c5c658ab0724 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c | |||
@@ -430,11 +430,13 @@ static int qede_get_coalesce(struct net_device *dev, | |||
430 | struct ethtool_coalesce *coal) | 430 | struct ethtool_coalesce *coal) |
431 | { | 431 | { |
432 | struct qede_dev *edev = netdev_priv(dev); | 432 | struct qede_dev *edev = netdev_priv(dev); |
433 | u16 rxc, txc; | ||
433 | 434 | ||
434 | memset(coal, 0, sizeof(struct ethtool_coalesce)); | 435 | memset(coal, 0, sizeof(struct ethtool_coalesce)); |
435 | edev->ops->common->get_coalesce(edev->cdev, | 436 | edev->ops->common->get_coalesce(edev->cdev, &rxc, &txc); |
436 | (u16 *)&coal->rx_coalesce_usecs, | 437 | |
437 | (u16 *)&coal->tx_coalesce_usecs); | 438 | coal->rx_coalesce_usecs = rxc; |
439 | coal->tx_coalesce_usecs = txc; | ||
438 | 440 | ||
439 | return 0; | 441 | return 0; |
440 | } | 442 | } |