Commit 5f54cebb authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/vxge: Remove unnecessary casts of netdev_priv

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarJon Mason <jon.mason@exar.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8739cfef
...@@ -80,7 +80,7 @@ static int vxge_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info) ...@@ -80,7 +80,7 @@ static int vxge_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
static void vxge_ethtool_gdrvinfo(struct net_device *dev, static void vxge_ethtool_gdrvinfo(struct net_device *dev,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
strlcpy(info->driver, VXGE_DRIVER_NAME, sizeof(VXGE_DRIVER_NAME)); strlcpy(info->driver, VXGE_DRIVER_NAME, sizeof(VXGE_DRIVER_NAME));
strlcpy(info->version, DRV_VERSION, sizeof(DRV_VERSION)); strlcpy(info->version, DRV_VERSION, sizeof(DRV_VERSION));
strlcpy(info->fw_version, vdev->fw_version, VXGE_HW_FW_STRLEN); strlcpy(info->fw_version, vdev->fw_version, VXGE_HW_FW_STRLEN);
...@@ -108,7 +108,7 @@ static void vxge_ethtool_gregs(struct net_device *dev, ...@@ -108,7 +108,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
enum vxge_hw_status status; enum vxge_hw_status status;
u64 reg; u64 reg;
u64 *reg_space = (u64 *)space; u64 *reg_space = (u64 *)space;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct __vxge_hw_device *hldev = vdev->devh; struct __vxge_hw_device *hldev = vdev->devh;
regs->len = sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath; regs->len = sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
...@@ -144,7 +144,7 @@ static void vxge_ethtool_gregs(struct net_device *dev, ...@@ -144,7 +144,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
*/ */
static int vxge_ethtool_idnic(struct net_device *dev, u32 data) static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct __vxge_hw_device *hldev = vdev->devh; struct __vxge_hw_device *hldev = vdev->devh;
vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON); vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
...@@ -166,7 +166,7 @@ static int vxge_ethtool_idnic(struct net_device *dev, u32 data) ...@@ -166,7 +166,7 @@ static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
static void vxge_ethtool_getpause_data(struct net_device *dev, static void vxge_ethtool_getpause_data(struct net_device *dev,
struct ethtool_pauseparam *ep) struct ethtool_pauseparam *ep)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct __vxge_hw_device *hldev = vdev->devh; struct __vxge_hw_device *hldev = vdev->devh;
vxge_hw_device_getpause_data(hldev, 0, &ep->tx_pause, &ep->rx_pause); vxge_hw_device_getpause_data(hldev, 0, &ep->tx_pause, &ep->rx_pause);
...@@ -185,7 +185,7 @@ static void vxge_ethtool_getpause_data(struct net_device *dev, ...@@ -185,7 +185,7 @@ static void vxge_ethtool_getpause_data(struct net_device *dev,
static int vxge_ethtool_setpause_data(struct net_device *dev, static int vxge_ethtool_setpause_data(struct net_device *dev,
struct ethtool_pauseparam *ep) struct ethtool_pauseparam *ep)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct __vxge_hw_device *hldev = vdev->devh; struct __vxge_hw_device *hldev = vdev->devh;
vxge_hw_device_setpause_data(hldev, 0, ep->tx_pause, ep->rx_pause); vxge_hw_device_setpause_data(hldev, 0, ep->tx_pause, ep->rx_pause);
...@@ -203,7 +203,7 @@ static void vxge_get_ethtool_stats(struct net_device *dev, ...@@ -203,7 +203,7 @@ static void vxge_get_ethtool_stats(struct net_device *dev,
enum vxge_hw_status status; enum vxge_hw_status status;
enum vxge_hw_status swstatus; enum vxge_hw_status swstatus;
struct vxge_vpath *vpath = NULL; struct vxge_vpath *vpath = NULL;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct __vxge_hw_device *hldev = vdev->devh; struct __vxge_hw_device *hldev = vdev->devh;
struct vxge_hw_xmac_stats *xmac_stats; struct vxge_hw_xmac_stats *xmac_stats;
struct vxge_hw_device_stats_sw_info *sw_stats; struct vxge_hw_device_stats_sw_info *sw_stats;
...@@ -572,7 +572,7 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset, ...@@ -572,7 +572,7 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
{ {
int stat_size = 0; int stat_size = 0;
int i, j; int i, j;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
switch (stringset) { switch (stringset) {
case ETH_SS_STATS: case ETH_SS_STATS:
vxge_add_string("VPATH STATISTICS%s\t\t\t", vxge_add_string("VPATH STATISTICS%s\t\t\t",
...@@ -1059,21 +1059,21 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset, ...@@ -1059,21 +1059,21 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
static int vxge_ethtool_get_regs_len(struct net_device *dev) static int vxge_ethtool_get_regs_len(struct net_device *dev)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
return sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath; return sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
} }
static u32 vxge_get_rx_csum(struct net_device *dev) static u32 vxge_get_rx_csum(struct net_device *dev)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
return vdev->rx_csum; return vdev->rx_csum;
} }
static int vxge_set_rx_csum(struct net_device *dev, u32 data) static int vxge_set_rx_csum(struct net_device *dev, u32 data)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
if (data) if (data)
vdev->rx_csum = 1; vdev->rx_csum = 1;
...@@ -1095,7 +1095,7 @@ static int vxge_ethtool_op_set_tso(struct net_device *dev, u32 data) ...@@ -1095,7 +1095,7 @@ static int vxge_ethtool_op_set_tso(struct net_device *dev, u32 data)
static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset) static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
switch (sset) { switch (sset) {
case ETH_SS_STATS: case ETH_SS_STATS:
...@@ -1114,7 +1114,7 @@ static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset) ...@@ -1114,7 +1114,7 @@ static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
static int vxge_set_flags(struct net_device *dev, u32 data) static int vxge_set_flags(struct net_device *dev, u32 data)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
enum vxge_hw_status status; enum vxge_hw_status status;
if (data & ~ETH_FLAG_RXHASH) if (data & ~ETH_FLAG_RXHASH)
...@@ -1148,7 +1148,7 @@ static int vxge_set_flags(struct net_device *dev, u32 data) ...@@ -1148,7 +1148,7 @@ static int vxge_set_flags(struct net_device *dev, u32 data)
static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms) static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms)
{ {
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) { if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) {
printk(KERN_INFO "Single Function Mode is required to flash the" printk(KERN_INFO "Single Function Mode is required to flash the"
......
...@@ -153,7 +153,7 @@ static void ...@@ -153,7 +153,7 @@ static void
vxge_callback_link_up(struct __vxge_hw_device *hldev) vxge_callback_link_up(struct __vxge_hw_device *hldev)
{ {
struct net_device *dev = hldev->ndev; struct net_device *dev = hldev->ndev;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d", vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
vdev->ndev->name, __func__, __LINE__); vdev->ndev->name, __func__, __LINE__);
...@@ -177,7 +177,7 @@ static void ...@@ -177,7 +177,7 @@ static void
vxge_callback_link_down(struct __vxge_hw_device *hldev) vxge_callback_link_down(struct __vxge_hw_device *hldev)
{ {
struct net_device *dev = hldev->ndev; struct net_device *dev = hldev->ndev;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
vxge_debug_entryexit(VXGE_TRACE, vxge_debug_entryexit(VXGE_TRACE,
"%s: %s:%d", vdev->ndev->name, __func__, __LINE__); "%s: %s:%d", vdev->ndev->name, __func__, __LINE__);
...@@ -787,7 +787,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -787,7 +787,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
if (unlikely(!is_vxge_card_up(vdev))) { if (unlikely(!is_vxge_card_up(vdev))) {
vxge_debug_tx(VXGE_ERR, vxge_debug_tx(VXGE_ERR,
...@@ -1052,7 +1052,7 @@ static void vxge_set_multicast(struct net_device *dev) ...@@ -1052,7 +1052,7 @@ static void vxge_set_multicast(struct net_device *dev)
vxge_debug_entryexit(VXGE_TRACE, vxge_debug_entryexit(VXGE_TRACE,
"%s:%d", __func__, __LINE__); "%s:%d", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
hldev = (struct __vxge_hw_device *)vdev->devh; hldev = (struct __vxge_hw_device *)vdev->devh;
if (unlikely(!is_vxge_card_up(vdev))) if (unlikely(!is_vxge_card_up(vdev)))
...@@ -1209,7 +1209,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p) ...@@ -1209,7 +1209,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__); vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
hldev = vdev->devh; hldev = vdev->devh;
if (!is_valid_ether_addr(addr->sa_data)) if (!is_valid_ether_addr(addr->sa_data))
...@@ -1672,7 +1672,7 @@ static void vxge_netpoll(struct net_device *dev) ...@@ -1672,7 +1672,7 @@ static void vxge_netpoll(struct net_device *dev)
struct __vxge_hw_device *hldev; struct __vxge_hw_device *hldev;
struct vxgedev *vdev; struct vxgedev *vdev;
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__); vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
...@@ -2582,7 +2582,7 @@ vxge_open(struct net_device *dev) ...@@ -2582,7 +2582,7 @@ vxge_open(struct net_device *dev)
vxge_debug_entryexit(VXGE_TRACE, vxge_debug_entryexit(VXGE_TRACE,
"%s: %s:%d", dev->name, __func__, __LINE__); "%s: %s:%d", dev->name, __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
function_mode = vdev->config.device_hw_info.function_mode; function_mode = vdev->config.device_hw_info.function_mode;
...@@ -2810,7 +2810,7 @@ static int do_vxge_close(struct net_device *dev, int do_io) ...@@ -2810,7 +2810,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d", vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
dev->name, __func__, __LINE__); dev->name, __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev); hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
if (unlikely(!is_vxge_card_up(vdev))) if (unlikely(!is_vxge_card_up(vdev)))
...@@ -3139,7 +3139,7 @@ vxge_tx_watchdog(struct net_device *dev) ...@@ -3139,7 +3139,7 @@ vxge_tx_watchdog(struct net_device *dev)
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__); vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
vdev->cric_err_event = VXGE_HW_EVENT_RESET_START; vdev->cric_err_event = VXGE_HW_EVENT_RESET_START;
...@@ -3167,7 +3167,7 @@ vxge_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ...@@ -3167,7 +3167,7 @@ vxge_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__); vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
vpath = &vdev->vpaths[0]; vpath = &vdev->vpaths[0];
if ((NULL == grp) && (vpath->is_open)) { if ((NULL == grp) && (vpath->is_open)) {
...@@ -3216,7 +3216,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) ...@@ -3216,7 +3216,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
struct vxge_vpath *vpath; struct vxge_vpath *vpath;
int vp_id; int vp_id;
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
/* Add these vlan to the vid table */ /* Add these vlan to the vid table */
for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) { for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) {
...@@ -3243,7 +3243,7 @@ vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) ...@@ -3243,7 +3243,7 @@ vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__); vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
vdev = (struct vxgedev *)netdev_priv(dev); vdev = netdev_priv(dev);
vlan_group_set_device(vdev->vlgrp, vid, NULL); vlan_group_set_device(vdev->vlgrp, vid, NULL);
...@@ -3476,7 +3476,7 @@ vxge_callback_crit_err(struct __vxge_hw_device *hldev, ...@@ -3476,7 +3476,7 @@ vxge_callback_crit_err(struct __vxge_hw_device *hldev,
enum vxge_hw_event type, u64 vp_id) enum vxge_hw_event type, u64 vp_id)
{ {
struct net_device *dev = hldev->ndev; struct net_device *dev = hldev->ndev;
struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); struct vxgedev *vdev = netdev_priv(dev);
struct vxge_vpath *vpath = NULL; struct vxge_vpath *vpath = NULL;
int vpath_idx; int vpath_idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment