aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-16 15:08:06 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-21 18:48:29 -0400
commit43d620c82985b19008d87a437b4cf83f356264f7 (patch)
tree8ea6d9d1ab5d36e7bc130b5189997e12edb01fb6 /drivers
parentdadbe85ac47f180fa1e3ef93b276ab7938b1a98b (diff)
drivers/net: Remove casts of void *
Unnecessary casts of void * clutter the code. These are the remainder casts after several specific patches to remove netdev_priv and dev_priv. Done via coccinelle script (and a little editing): $ cat cast_void_pointer.cocci @@ type T; T *pt; void *pv; @@ - pt = (T *)pv; + pt = pv; Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Acked-By: Chris Snook <chris.snook@gmail.com> Acked-by: Jon Mason <jdmason@kudzu.us> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: David Dillow <dave@thedillows.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/a2065.c11
-rw-r--r--drivers/net/appletalk/ltpc.c8
-rw-r--r--drivers/net/atl1e/atl1e_main.c5
-rw-r--r--drivers/net/atlx/atl2.c3
-rw-r--r--drivers/net/benet/be_cmds.c3
-rw-r--r--drivers/net/benet/be_ethtool.c4
-rw-r--r--drivers/net/bna/bfa_cee.c2
-rw-r--r--drivers/net/bna/cna.h2
-rw-r--r--drivers/net/caif/caif_shmcore.c2
-rw-r--r--drivers/net/cnic.c4
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c2
-rw-r--r--drivers/net/davinci_cpdma.c2
-rw-r--r--drivers/net/declance.c38
-rw-r--r--drivers/net/depca.c4
-rw-r--r--drivers/net/dl2k.c4
-rw-r--r--drivers/net/ehea/ehea_qmr.c2
-rw-r--r--drivers/net/epic100.c4
-rw-r--r--drivers/net/fealnx.c4
-rw-r--r--drivers/net/gianfar.c4
-rw-r--r--drivers/net/hamachi.c4
-rw-r--r--drivers/net/macmace.c2
-rw-r--r--drivers/net/mlx4/en_rx.c2
-rw-r--r--drivers/net/mlx4/en_tx.c5
-rw-r--r--drivers/net/netxen/netxen_nic_ctx.c16
-rw-r--r--drivers/net/pxa168_eth.c2
-rw-r--r--drivers/net/qla3xxx.c5
-rw-r--r--drivers/net/qlcnic/qlcnic_ctx.c26
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c2
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c3
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c2
-rw-r--r--drivers/net/qlge/qlge_main.c4
-rw-r--r--drivers/net/s2io.c18
-rw-r--r--drivers/net/sfc/siena.c2
-rw-r--r--drivers/net/sis900.c4
-rw-r--r--drivers/net/tokenring/madgemc.c2
-rw-r--r--drivers/net/typhoon.c2
-rw-r--r--drivers/net/vxge/vxge-config.c44
-rw-r--r--drivers/net/vxge/vxge-traffic.c6
-rw-r--r--drivers/net/wan/pc300_tty.c2
-rw-r--r--drivers/net/xilinx_emaclite.c4
-rw-r--r--drivers/net/yellowfin.c6
41 files changed, 124 insertions, 147 deletions
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index deaa8bc16cf8..25ea98aacf38 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -421,16 +421,11 @@ static int lance_tx (struct net_device *dev)
421 421
422static irqreturn_t lance_interrupt (int irq, void *dev_id) 422static irqreturn_t lance_interrupt (int irq, void *dev_id)
423{ 423{
424 struct net_device *dev; 424 struct net_device *dev = dev_id;
425 struct lance_private *lp; 425 struct lance_private *lp = netdev_priv(dev);
426 volatile struct lance_regs *ll; 426 volatile struct lance_regs *ll = lp->ll;
427 int csr0; 427 int csr0;
428 428
429 dev = (struct net_device *) dev_id;
430
431 lp = netdev_priv(dev);
432 ll = lp->ll;
433
434 ll->rap = LE_CSR0; /* LANCE Controller Status */ 429 ll->rap = LE_CSR0; /* LANCE Controller Status */
435 csr0 = ll->rdp; 430 csr0 = ll->rdp;
436 431
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index e69eead12ec7..34ffb5422628 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -652,9 +652,9 @@ static int do_write(struct net_device *dev, void *cbuf, int cbuflen,
652 int ret; 652 int ret;
653 653
654 if(i) { 654 if(i) {
655 qels[i].cbuf = (unsigned char *) cbuf; 655 qels[i].cbuf = cbuf;
656 qels[i].cbuflen = cbuflen; 656 qels[i].cbuflen = cbuflen;
657 qels[i].dbuf = (unsigned char *) dbuf; 657 qels[i].dbuf = dbuf;
658 qels[i].dbuflen = dbuflen; 658 qels[i].dbuflen = dbuflen;
659 qels[i].QWrite = 1; 659 qels[i].QWrite = 1;
660 qels[i].mailbox = i; /* this should be initted rather */ 660 qels[i].mailbox = i; /* this should be initted rather */
@@ -676,9 +676,9 @@ static int do_read(struct net_device *dev, void *cbuf, int cbuflen,
676 int ret; 676 int ret;
677 677
678 if(i) { 678 if(i) {
679 qels[i].cbuf = (unsigned char *) cbuf; 679 qels[i].cbuf = cbuf;
680 qels[i].cbuflen = cbuflen; 680 qels[i].cbuflen = cbuflen;
681 qels[i].dbuf = (unsigned char *) dbuf; 681 qels[i].dbuf = dbuf;
682 qels[i].dbuflen = dbuflen; 682 qels[i].dbuflen = dbuflen;
683 qels[i].QWrite = 0; 683 qels[i].QWrite = 0;
684 qels[i].mailbox = i; /* this should be initted rather */ 684 qels[i].mailbox = i; /* this should be initted rather */
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index 86a912283134..c3c5db13cf22 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -800,8 +800,7 @@ static int atl1e_setup_ring_resources(struct atl1e_adapter *adapter)
800 /* Init TPD Ring */ 800 /* Init TPD Ring */
801 tx_ring->dma = roundup(adapter->ring_dma, 8); 801 tx_ring->dma = roundup(adapter->ring_dma, 8);
802 offset = tx_ring->dma - adapter->ring_dma; 802 offset = tx_ring->dma - adapter->ring_dma;
803 tx_ring->desc = (struct atl1e_tpd_desc *) 803 tx_ring->desc = adapter->ring_vir_addr + offset;
804 (adapter->ring_vir_addr + offset);
805 size = sizeof(struct atl1e_tx_buffer) * (tx_ring->count); 804 size = sizeof(struct atl1e_tx_buffer) * (tx_ring->count);
806 tx_ring->tx_buffer = kzalloc(size, GFP_KERNEL); 805 tx_ring->tx_buffer = kzalloc(size, GFP_KERNEL);
807 if (tx_ring->tx_buffer == NULL) { 806 if (tx_ring->tx_buffer == NULL) {
@@ -827,7 +826,7 @@ static int atl1e_setup_ring_resources(struct atl1e_adapter *adapter)
827 826
828 /* Init CMB dma address */ 827 /* Init CMB dma address */
829 tx_ring->cmb_dma = adapter->ring_dma + offset; 828 tx_ring->cmb_dma = adapter->ring_dma + offset;
830 tx_ring->cmb = (u32 *)(adapter->ring_vir_addr + offset); 829 tx_ring->cmb = adapter->ring_vir_addr + offset;
831 offset += sizeof(u32); 830 offset += sizeof(u32);
832 831
833 for (i = 0; i < adapter->num_rx_queues; i++) { 832 for (i = 0; i < adapter->num_rx_queues; i++) {
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index 16249e9b6b95..24e15926ceea 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -311,8 +311,7 @@ static s32 atl2_setup_ring_resources(struct atl2_adapter *adapter)
311 adapter->txd_dma = adapter->ring_dma ; 311 adapter->txd_dma = adapter->ring_dma ;
312 offset = (adapter->txd_dma & 0x7) ? (8 - (adapter->txd_dma & 0x7)) : 0; 312 offset = (adapter->txd_dma & 0x7) ? (8 - (adapter->txd_dma & 0x7)) : 0;
313 adapter->txd_dma += offset; 313 adapter->txd_dma += offset;
314 adapter->txd_ring = (struct tx_pkt_header *) (adapter->ring_vir_addr + 314 adapter->txd_ring = adapter->ring_vir_addr + offset;
315 offset);
316 315
317 /* Init TXS Ring */ 316 /* Init TXS Ring */
318 adapter->txs_dma = adapter->txd_dma + adapter->txd_ring_size; 317 adapter->txs_dma = adapter->txd_dma + adapter->txd_ring_size;
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 0c12c2d4532a..30719f591fb2 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -2334,8 +2334,7 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
2334 2334
2335 status = be_mbox_notify_wait(adapter); 2335 status = be_mbox_notify_wait(adapter);
2336 if (!status) { 2336 if (!status) {
2337 attribs = (struct mgmt_controller_attrib *)( attribs_cmd.va + 2337 attribs = attribs_cmd.va + sizeof(struct be_cmd_resp_hdr);
2338 sizeof(struct be_cmd_resp_hdr));
2339 adapter->hba_port_num = attribs->hba_attribs.phy_port; 2338 adapter->hba_port_num = attribs->hba_attribs.phy_port;
2340 } 2339 }
2341 2340
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 84e03a747868..30c1386027f8 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -408,7 +408,7 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
408 } 408 }
409 status = be_cmd_get_phy_info(adapter, &phy_cmd); 409 status = be_cmd_get_phy_info(adapter, &phy_cmd);
410 if (!status) { 410 if (!status) {
411 resp = (struct be_cmd_resp_get_phy_info *) phy_cmd.va; 411 resp = phy_cmd.va;
412 intf_type = le16_to_cpu(resp->interface_type); 412 intf_type = le16_to_cpu(resp->interface_type);
413 413
414 switch (intf_type) { 414 switch (intf_type) {
@@ -712,7 +712,7 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
712 status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd); 712 status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);
713 713
714 if (!status) { 714 if (!status) {
715 resp = (struct be_cmd_resp_seeprom_read *) eeprom_cmd.va; 715 resp = eeprom_cmd.va;
716 memcpy(data, resp->seeprom_data + eeprom->offset, eeprom->len); 716 memcpy(data, resp->seeprom_data + eeprom->offset, eeprom->len);
717 } 717 }
718 dma_free_coherent(&adapter->pdev->dev, eeprom_cmd.size, eeprom_cmd.va, 718 dma_free_coherent(&adapter->pdev->dev, eeprom_cmd.size, eeprom_cmd.va,
diff --git a/drivers/net/bna/bfa_cee.c b/drivers/net/bna/bfa_cee.c
index f7b789a3b217..dcfbf08bcf43 100644
--- a/drivers/net/bna/bfa_cee.c
+++ b/drivers/net/bna/bfa_cee.c
@@ -236,7 +236,7 @@ static void
236bfa_cee_hbfail(void *arg) 236bfa_cee_hbfail(void *arg)
237{ 237{
238 struct bfa_cee *cee; 238 struct bfa_cee *cee;
239 cee = (struct bfa_cee *) arg; 239 cee = arg;
240 240
241 if (cee->get_attr_pending == true) { 241 if (cee->get_attr_pending == true) {
242 cee->get_attr_status = BFA_STATUS_FAILED; 242 cee->get_attr_status = BFA_STATUS_FAILED;
diff --git a/drivers/net/bna/cna.h b/drivers/net/bna/cna.h
index bbd39dc65972..3c47dc52b423 100644
--- a/drivers/net/bna/cna.h
+++ b/drivers/net/bna/cna.h
@@ -74,7 +74,7 @@ typedef struct mac { u8 mac[MAC_ADDRLEN]; } mac_t;
74 bfa_q_next(_q) = bfa_q_next(*((struct list_head **) _qe)); \ 74 bfa_q_next(_q) = bfa_q_next(*((struct list_head **) _qe)); \
75 bfa_q_qe_init(*((struct list_head **) _qe)); \ 75 bfa_q_qe_init(*((struct list_head **) _qe)); \
76 } else { \ 76 } else { \
77 *((struct list_head **) (_qe)) = (struct list_head *) NULL; \ 77 *((struct list_head **)(_qe)) = NULL; \
78 } \ 78 } \
79} 79}
80 80
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c
index 731aa1193770..d4b26fb24ed9 100644
--- a/drivers/net/caif/caif_shmcore.c
+++ b/drivers/net/caif/caif_shmcore.c
@@ -134,7 +134,7 @@ int caif_shmdrv_rx_cb(u32 mbx_msg, void *priv)
134 u32 avail_emptybuff = 0; 134 u32 avail_emptybuff = 0;
135 unsigned long flags = 0; 135 unsigned long flags = 0;
136 136
137 pshm_drv = (struct shmdrv_layer *)priv; 137 pshm_drv = priv;
138 138
139 /* Check for received buffers. */ 139 /* Check for received buffers. */
140 if (mbx_msg & SHM_FULL_MASK) { 140 if (mbx_msg & SHM_FULL_MASK) {
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index e66c3d9ab2c6..5533b1526b1b 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -4318,7 +4318,7 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)
4318 val = BNX2_L2CTX_CMD_TYPE_TYPE_L2 | (8 << 16); 4318 val = BNX2_L2CTX_CMD_TYPE_TYPE_L2 | (8 << 16);
4319 cnic_ctx_wr(dev, cid_addr, offset1, val); 4319 cnic_ctx_wr(dev, cid_addr, offset1, val);
4320 4320
4321 txbd = (struct tx_bd *) udev->l2_ring; 4321 txbd = udev->l2_ring;
4322 4322
4323 buf_map = udev->l2_buf_map; 4323 buf_map = udev->l2_buf_map;
4324 for (i = 0; i < MAX_TX_DESC_CNT; i++, txbd++) { 4324 for (i = 0; i < MAX_TX_DESC_CNT; i++, txbd++) {
@@ -4377,7 +4377,7 @@ static void cnic_init_bnx2_rx_ring(struct cnic_dev *dev)
4377 val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id); 4377 val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id);
4378 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val); 4378 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val);
4379 4379
4380 rxbd = (struct rx_bd *) (udev->l2_ring + BCM_PAGE_SIZE); 4380 rxbd = udev->l2_ring + BCM_PAGE_SIZE;
4381 for (i = 0; i < MAX_RX_DESC_CNT; i++, rxbd++) { 4381 for (i = 0; i < MAX_RX_DESC_CNT; i++, rxbd++) {
4382 dma_addr_t buf_map; 4382 dma_addr_t buf_map;
4383 int n = (i % cp->l2_rx_ring_size) + 1; 4383 int n = (i % cp->l2_rx_ring_size) + 1;
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 862804f32b6e..9db9068d29d2 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -567,7 +567,7 @@ static void t3_process_tid_release_list(struct work_struct *work)
567 while (td->tid_release_list) { 567 while (td->tid_release_list) {
568 struct t3c_tid_entry *p = td->tid_release_list; 568 struct t3c_tid_entry *p = td->tid_release_list;
569 569
570 td->tid_release_list = (struct t3c_tid_entry *)p->ctx; 570 td->tid_release_list = p->ctx;
571 spin_unlock_bh(&td->tid_release_lock); 571 spin_unlock_bh(&td->tid_release_lock);
572 572
573 skb = alloc_skb(sizeof(struct cpl_tid_release), 573 skb = alloc_skb(sizeof(struct cpl_tid_release),
diff --git a/drivers/net/davinci_cpdma.c b/drivers/net/davinci_cpdma.c
index ae47f23ba930..dca9d3369cdd 100644
--- a/drivers/net/davinci_cpdma.c
+++ b/drivers/net/davinci_cpdma.c
@@ -167,7 +167,7 @@ cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr,
167 } else { 167 } else {
168 pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys, 168 pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys,
169 GFP_KERNEL); 169 GFP_KERNEL);
170 pool->iomap = (void __force __iomem *)pool->cpumap; 170 pool->iomap = pool->cpumap;
171 pool->hw_addr = pool->phys; 171 pool->hw_addr = pool->phys;
172 } 172 }
173 173
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index 219eb5ad5c12..cabd3a542ef0 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -326,15 +326,18 @@ static void load_csrs(struct lance_private *lp)
326 */ 326 */
327static void cp_to_buf(const int type, void *to, const void *from, int len) 327static void cp_to_buf(const int type, void *to, const void *from, int len)
328{ 328{
329 unsigned short *tp, *fp, clen; 329 unsigned short *tp;
330 unsigned char *rtp, *rfp; 330 const unsigned short *fp;
331 unsigned short clen;
332 unsigned char *rtp;
333 const unsigned char *rfp;
331 334
332 if (type == PMAD_LANCE) { 335 if (type == PMAD_LANCE) {
333 memcpy(to, from, len); 336 memcpy(to, from, len);
334 } else if (type == PMAX_LANCE) { 337 } else if (type == PMAX_LANCE) {
335 clen = len >> 1; 338 clen = len >> 1;
336 tp = (unsigned short *) to; 339 tp = to;
337 fp = (unsigned short *) from; 340 fp = from;
338 341
339 while (clen--) { 342 while (clen--) {
340 *tp++ = *fp++; 343 *tp++ = *fp++;
@@ -342,8 +345,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
342 } 345 }
343 346
344 clen = len & 1; 347 clen = len & 1;
345 rtp = (unsigned char *) tp; 348 rtp = tp;
346 rfp = (unsigned char *) fp; 349 rfp = fp;
347 while (clen--) { 350 while (clen--) {
348 *rtp++ = *rfp++; 351 *rtp++ = *rfp++;
349 } 352 }
@@ -352,8 +355,8 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
352 * copy 16 Byte chunks 355 * copy 16 Byte chunks
353 */ 356 */
354 clen = len >> 4; 357 clen = len >> 4;
355 tp = (unsigned short *) to; 358 tp = to;
356 fp = (unsigned short *) from; 359 fp = from;
357 while (clen--) { 360 while (clen--) {
358 *tp++ = *fp++; 361 *tp++ = *fp++;
359 *tp++ = *fp++; 362 *tp++ = *fp++;
@@ -382,15 +385,18 @@ static void cp_to_buf(const int type, void *to, const void *from, int len)
382 385
383static void cp_from_buf(const int type, void *to, const void *from, int len) 386static void cp_from_buf(const int type, void *to, const void *from, int len)
384{ 387{
385 unsigned short *tp, *fp, clen; 388 unsigned short *tp;
386 unsigned char *rtp, *rfp; 389 const unsigned short *fp;
390 unsigned short clen;
391 unsigned char *rtp;
392 const unsigned char *rfp;
387 393
388 if (type == PMAD_LANCE) { 394 if (type == PMAD_LANCE) {
389 memcpy(to, from, len); 395 memcpy(to, from, len);
390 } else if (type == PMAX_LANCE) { 396 } else if (type == PMAX_LANCE) {
391 clen = len >> 1; 397 clen = len >> 1;
392 tp = (unsigned short *) to; 398 tp = to;
393 fp = (unsigned short *) from; 399 fp = from;
394 while (clen--) { 400 while (clen--) {
395 *tp++ = *fp++; 401 *tp++ = *fp++;
396 fp++; 402 fp++;
@@ -398,8 +404,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len)
398 404
399 clen = len & 1; 405 clen = len & 1;
400 406
401 rtp = (unsigned char *) tp; 407 rtp = tp;
402 rfp = (unsigned char *) fp; 408 rfp = fp;
403 409
404 while (clen--) { 410 while (clen--) {
405 *rtp++ = *rfp++; 411 *rtp++ = *rfp++;
@@ -410,8 +416,8 @@ static void cp_from_buf(const int type, void *to, const void *from, int len)
410 * copy 16 Byte chunks 416 * copy 16 Byte chunks
411 */ 417 */
412 clen = len >> 4; 418 clen = len >> 4;
413 tp = (unsigned short *) to; 419 tp = to;
414 fp = (unsigned short *) from; 420 fp = from;
415 while (clen--) { 421 while (clen--) {
416 *tp++ = *fp++; 422 *tp++ = *fp++;
417 *tp++ = *fp++; 423 *tp++ = *fp++;
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 8b0084d17c8c..d54a0e93ba93 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -708,11 +708,11 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
708 708
709 /* Tx & Rx descriptors (aligned to a quadword boundary) */ 709 /* Tx & Rx descriptors (aligned to a quadword boundary) */
710 offset = (offset + DEPCA_ALIGN) & ~DEPCA_ALIGN; 710 offset = (offset + DEPCA_ALIGN) & ~DEPCA_ALIGN;
711 lp->rx_ring = (struct depca_rx_desc __iomem *) (lp->sh_mem + offset); 711 lp->rx_ring = lp->sh_mem + offset;
712 lp->rx_ring_offset = offset; 712 lp->rx_ring_offset = offset;
713 713
714 offset += (sizeof(struct depca_rx_desc) * NUM_RX_DESC); 714 offset += (sizeof(struct depca_rx_desc) * NUM_RX_DESC);
715 lp->tx_ring = (struct depca_tx_desc __iomem *) (lp->sh_mem + offset); 715 lp->tx_ring = lp->sh_mem + offset;
716 lp->tx_ring_offset = offset; 716 lp->tx_ring_offset = offset;
717 717
718 offset += (sizeof(struct depca_tx_desc) * NUM_TX_DESC); 718 offset += (sizeof(struct depca_tx_desc) * NUM_TX_DESC);
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 23179dbcedd2..ed73e4a93508 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -221,13 +221,13 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
221 ring_space = pci_alloc_consistent (pdev, TX_TOTAL_SIZE, &ring_dma); 221 ring_space = pci_alloc_consistent (pdev, TX_TOTAL_SIZE, &ring_dma);
222 if (!ring_space) 222 if (!ring_space)
223 goto err_out_iounmap; 223 goto err_out_iounmap;
224 np->tx_ring = (struct netdev_desc *) ring_space; 224 np->tx_ring = ring_space;
225 np->tx_ring_dma = ring_dma; 225 np->tx_ring_dma = ring_dma;
226 226
227 ring_space = pci_alloc_consistent (pdev, RX_TOTAL_SIZE, &ring_dma); 227 ring_space = pci_alloc_consistent (pdev, RX_TOTAL_SIZE, &ring_dma);
228 if (!ring_space) 228 if (!ring_space)
229 goto err_out_unmap_tx; 229 goto err_out_unmap_tx;
230 np->rx_ring = (struct netdev_desc *) ring_space; 230 np->rx_ring = ring_space;
231 np->rx_ring_dma = ring_dma; 231 np->rx_ring_dma = ring_dma;
232 232
233 /* Parse eeprom data */ 233 /* Parse eeprom data */
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index cd44bb8017d9..95b9f4fa811e 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -331,7 +331,7 @@ struct ehea_eqe *ehea_poll_eq(struct ehea_eq *eq)
331 unsigned long flags; 331 unsigned long flags;
332 332
333 spin_lock_irqsave(&eq->spinlock, flags); 333 spin_lock_irqsave(&eq->spinlock, flags);
334 eqe = (struct ehea_eqe *)hw_eqit_eq_get_inc_valid(&eq->hw_queue); 334 eqe = hw_eqit_eq_get_inc_valid(&eq->hw_queue);
335 spin_unlock_irqrestore(&eq->spinlock, flags); 335 spin_unlock_irqrestore(&eq->spinlock, flags);
336 336
337 return eqe; 337 return eqe;
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index c353bf3113cc..814c187d5f95 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -391,13 +391,13 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
391 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma); 391 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
392 if (!ring_space) 392 if (!ring_space)
393 goto err_out_iounmap; 393 goto err_out_iounmap;
394 ep->tx_ring = (struct epic_tx_desc *)ring_space; 394 ep->tx_ring = ring_space;
395 ep->tx_ring_dma = ring_dma; 395 ep->tx_ring_dma = ring_dma;
396 396
397 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma); 397 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma);
398 if (!ring_space) 398 if (!ring_space)
399 goto err_out_unmap_tx; 399 goto err_out_unmap_tx;
400 ep->rx_ring = (struct epic_rx_desc *)ring_space; 400 ep->rx_ring = ring_space;
401 ep->rx_ring_dma = ring_dma; 401 ep->rx_ring_dma = ring_dma;
402 402
403 if (dev->mem_start) { 403 if (dev->mem_start) {
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index dd54abe2f710..fa8677c32384 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -566,7 +566,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
566 err = -ENOMEM; 566 err = -ENOMEM;
567 goto err_out_free_dev; 567 goto err_out_free_dev;
568 } 568 }
569 np->rx_ring = (struct fealnx_desc *)ring_space; 569 np->rx_ring = ring_space;
570 np->rx_ring_dma = ring_dma; 570 np->rx_ring_dma = ring_dma;
571 571
572 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma); 572 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
@@ -574,7 +574,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
574 err = -ENOMEM; 574 err = -ENOMEM;
575 goto err_out_free_rx; 575 goto err_out_free_rx;
576 } 576 }
577 np->tx_ring = (struct fealnx_desc *)ring_space; 577 np->tx_ring = ring_space;
578 np->tx_ring_dma = ring_dma; 578 np->tx_ring_dma = ring_dma;
579 579
580 /* find the connected MII xcvrs */ 580 /* find the connected MII xcvrs */
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index dc0a7aa42b2e..3321d714ca22 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -267,7 +267,7 @@ static int gfar_alloc_skb_resources(struct net_device *ndev)
267 267
268 for (i = 0; i < priv->num_tx_queues; i++) { 268 for (i = 0; i < priv->num_tx_queues; i++) {
269 tx_queue = priv->tx_queue[i]; 269 tx_queue = priv->tx_queue[i];
270 tx_queue->tx_bd_base = (struct txbd8 *) vaddr; 270 tx_queue->tx_bd_base = vaddr;
271 tx_queue->tx_bd_dma_base = addr; 271 tx_queue->tx_bd_dma_base = addr;
272 tx_queue->dev = ndev; 272 tx_queue->dev = ndev;
273 /* enet DMA only understands physical addresses */ 273 /* enet DMA only understands physical addresses */
@@ -278,7 +278,7 @@ static int gfar_alloc_skb_resources(struct net_device *ndev)
278 /* Start the rx descriptor ring where the tx ring leaves off */ 278 /* Start the rx descriptor ring where the tx ring leaves off */
279 for (i = 0; i < priv->num_rx_queues; i++) { 279 for (i = 0; i < priv->num_rx_queues; i++) {
280 rx_queue = priv->rx_queue[i]; 280 rx_queue = priv->rx_queue[i];
281 rx_queue->rx_bd_base = (struct rxbd8 *) vaddr; 281 rx_queue->rx_bd_base = vaddr;
282 rx_queue->rx_bd_dma_base = addr; 282 rx_queue->rx_bd_dma_base = addr;
283 rx_queue->dev = ndev; 283 rx_queue->dev = ndev;
284 addr += sizeof (struct rxbd8) * rx_queue->rx_ring_size; 284 addr += sizeof (struct rxbd8) * rx_queue->rx_ring_size;
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index a09041aa8509..c274b3d77eb5 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -648,13 +648,13 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
648 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma); 648 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
649 if (!ring_space) 649 if (!ring_space)
650 goto err_out_cleardev; 650 goto err_out_cleardev;
651 hmp->tx_ring = (struct hamachi_desc *)ring_space; 651 hmp->tx_ring = ring_space;
652 hmp->tx_ring_dma = ring_dma; 652 hmp->tx_ring_dma = ring_dma;
653 653
654 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma); 654 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma);
655 if (!ring_space) 655 if (!ring_space)
656 goto err_out_unmap_tx; 656 goto err_out_unmap_tx;
657 hmp->rx_ring = (struct hamachi_desc *)ring_space; 657 hmp->rx_ring = ring_space;
658 hmp->rx_ring_dma = ring_dma; 658 hmp->rx_ring_dma = ring_dma;
659 659
660 /* Check for options being passed in */ 660 /* Check for options being passed in */
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c
index c685a4656878..4286e67f9634 100644
--- a/drivers/net/macmace.c
+++ b/drivers/net/macmace.c
@@ -221,7 +221,7 @@ static int __devinit mace_probe(struct platform_device *pdev)
221 SET_NETDEV_DEV(dev, &pdev->dev); 221 SET_NETDEV_DEV(dev, &pdev->dev);
222 222
223 dev->base_addr = (u32)MACE_BASE; 223 dev->base_addr = (u32)MACE_BASE;
224 mp->mace = (volatile struct mace *) MACE_BASE; 224 mp->mace = MACE_BASE;
225 225
226 dev->irq = IRQ_MAC_MACE; 226 dev->irq = IRQ_MAC_MACE;
227 mp->dma_intr = IRQ_MAC_MACE_DMA; 227 mp->dma_intr = IRQ_MAC_MACE_DMA;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 277215fb9d72..5197b50b2d81 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -859,7 +859,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
859 priv->rx_ring[0].cqn, &context); 859 priv->rx_ring[0].cqn, &context);
860 860
861 ptr = ((void *) &context) + 0x3c; 861 ptr = ((void *) &context) + 0x3c;
862 rss_context = (struct mlx4_en_rss_context *) ptr; 862 rss_context = ptr;
863 rss_context->base_qpn = cpu_to_be32(ilog2(priv->rx_ring_num) << 24 | 863 rss_context->base_qpn = cpu_to_be32(ilog2(priv->rx_ring_num) << 24 |
864 (rss_map->base_qpn)); 864 (rss_map->base_qpn));
865 rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn); 865 rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn);
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index b229acf1855f..6e03de034ac7 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -238,8 +238,7 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
238 } else { 238 } else {
239 if (!tx_info->inl) { 239 if (!tx_info->inl) {
240 if ((void *) data >= end) { 240 if ((void *) data >= end) {
241 data = (struct mlx4_wqe_data_seg *) 241 data = ring->buf + ((void *)data - end);
242 (ring->buf + ((void *) data - end));
243 } 242 }
244 243
245 if (tx_info->linear) { 244 if (tx_info->linear) {
@@ -253,7 +252,7 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
253 for (i = 0; i < frags; i++) { 252 for (i = 0; i < frags; i++) {
254 /* Check for wraparound before unmapping */ 253 /* Check for wraparound before unmapping */
255 if ((void *) data >= end) 254 if ((void *) data >= end)
256 data = (struct mlx4_wqe_data_seg *) ring->buf; 255 data = ring->buf;
257 frag = &skb_shinfo(skb)->frags[i]; 256 frag = &skb_shinfo(skb)->frags[i];
258 pci_unmap_page(mdev->pdev, 257 pci_unmap_page(mdev->pdev,
259 (dma_addr_t) be64_to_cpu(data->addr), 258 (dma_addr_t) be64_to_cpu(data->addr),
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index f16966afa64e..a925392abd6f 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -163,7 +163,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
163 rq_size, &hostrq_phys_addr); 163 rq_size, &hostrq_phys_addr);
164 if (addr == NULL) 164 if (addr == NULL)
165 return -ENOMEM; 165 return -ENOMEM;
166 prq = (nx_hostrq_rx_ctx_t *)addr; 166 prq = addr;
167 167
168 addr = pci_alloc_consistent(adapter->pdev, 168 addr = pci_alloc_consistent(adapter->pdev,
169 rsp_size, &cardrsp_phys_addr); 169 rsp_size, &cardrsp_phys_addr);
@@ -171,7 +171,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
171 err = -ENOMEM; 171 err = -ENOMEM;
172 goto out_free_rq; 172 goto out_free_rq;
173 } 173 }
174 prsp = (nx_cardrsp_rx_ctx_t *)addr; 174 prsp = addr;
175 175
176 prq->host_rsp_dma_addr = cpu_to_le64(cardrsp_phys_addr); 176 prq->host_rsp_dma_addr = cpu_to_le64(cardrsp_phys_addr);
177 177
@@ -318,10 +318,10 @@ nx_fw_cmd_create_tx_ctx(struct netxen_adapter *adapter)
318 } 318 }
319 319
320 memset(rq_addr, 0, rq_size); 320 memset(rq_addr, 0, rq_size);
321 prq = (nx_hostrq_tx_ctx_t *)rq_addr; 321 prq = rq_addr;
322 322
323 memset(rsp_addr, 0, rsp_size); 323 memset(rsp_addr, 0, rsp_size);
324 prsp = (nx_cardrsp_tx_ctx_t *)rsp_addr; 324 prsp = rsp_addr;
325 325
326 prq->host_rsp_dma_addr = cpu_to_le64(rsp_phys_addr); 326 prq->host_rsp_dma_addr = cpu_to_le64(rsp_phys_addr);
327 327
@@ -629,7 +629,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
629 } 629 }
630 630
631 memset(addr, 0, sizeof(struct netxen_ring_ctx)); 631 memset(addr, 0, sizeof(struct netxen_ring_ctx));
632 recv_ctx->hwctx = (struct netxen_ring_ctx *)addr; 632 recv_ctx->hwctx = addr;
633 recv_ctx->hwctx->ctx_id = cpu_to_le32(port); 633 recv_ctx->hwctx->ctx_id = cpu_to_le32(port);
634 recv_ctx->hwctx->cmd_consumer_offset = 634 recv_ctx->hwctx->cmd_consumer_offset =
635 cpu_to_le64(recv_ctx->phys_addr + 635 cpu_to_le64(recv_ctx->phys_addr +
@@ -648,7 +648,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
648 goto err_out_free; 648 goto err_out_free;
649 } 649 }
650 650
651 tx_ring->desc_head = (struct cmd_desc_type0 *)addr; 651 tx_ring->desc_head = addr;
652 652
653 for (ring = 0; ring < adapter->max_rds_rings; ring++) { 653 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
654 rds_ring = &recv_ctx->rds_rings[ring]; 654 rds_ring = &recv_ctx->rds_rings[ring];
@@ -662,7 +662,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
662 err = -ENOMEM; 662 err = -ENOMEM;
663 goto err_out_free; 663 goto err_out_free;
664 } 664 }
665 rds_ring->desc_head = (struct rcv_desc *)addr; 665 rds_ring->desc_head = addr;
666 666
667 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) 667 if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
668 rds_ring->crb_rcv_producer = 668 rds_ring->crb_rcv_producer =
@@ -683,7 +683,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
683 err = -ENOMEM; 683 err = -ENOMEM;
684 goto err_out_free; 684 goto err_out_free;
685 } 685 }
686 sds_ring->desc_head = (struct status_desc *)addr; 686 sds_ring->desc_head = addr;
687 687
688 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { 688 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
689 sds_ring->crb_sts_consumer = 689 sds_ring->crb_sts_consumer =
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c
index 1f97db1fc4b1..c1bb05be7a7c 100644
--- a/drivers/net/pxa168_eth.c
+++ b/drivers/net/pxa168_eth.c
@@ -502,7 +502,7 @@ static int add_del_hash_entry(struct pxa168_eth_private *pep,
502 * Pick the appropriate table, start scanning for free/reusable 502 * Pick the appropriate table, start scanning for free/reusable
503 * entries at the index obtained by hashing the specified MAC address 503 * entries at the index obtained by hashing the specified MAC address
504 */ 504 */
505 start = (struct addr_table_entry *)(pep->htpr); 505 start = pep->htpr;
506 entry = start + hash_function(mac_addr); 506 entry = start + hash_function(mac_addr);
507 for (i = 0; i < HOP_NUMBER; i++) { 507 for (i = 0; i < HOP_NUMBER; i++) {
508 if (!(le32_to_cpu(entry->lo) & HASH_ENTRY_VALID)) { 508 if (!(le32_to_cpu(entry->lo) & HASH_ENTRY_VALID)) {
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 771bb614ccc9..2f6914025efc 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -2873,7 +2873,7 @@ static int ql_alloc_mem_resources(struct ql3_adapter *qdev)
2873 PAGE_SIZE, &qdev->shadow_reg_phy_addr); 2873 PAGE_SIZE, &qdev->shadow_reg_phy_addr);
2874 2874
2875 if (qdev->shadow_reg_virt_addr != NULL) { 2875 if (qdev->shadow_reg_virt_addr != NULL) {
2876 qdev->preq_consumer_index = (u16 *) qdev->shadow_reg_virt_addr; 2876 qdev->preq_consumer_index = qdev->shadow_reg_virt_addr;
2877 qdev->req_consumer_index_phy_addr_high = 2877 qdev->req_consumer_index_phy_addr_high =
2878 MS_64BITS(qdev->shadow_reg_phy_addr); 2878 MS_64BITS(qdev->shadow_reg_phy_addr);
2879 qdev->req_consumer_index_phy_addr_low = 2879 qdev->req_consumer_index_phy_addr_low =
@@ -3114,8 +3114,7 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
3114 qdev->small_buf_release_cnt = 8; 3114 qdev->small_buf_release_cnt = 8;
3115 qdev->lrg_buf_q_producer_index = qdev->num_lbufq_entries - 1; 3115 qdev->lrg_buf_q_producer_index = qdev->num_lbufq_entries - 1;
3116 qdev->lrg_buf_release_cnt = 8; 3116 qdev->lrg_buf_release_cnt = 8;
3117 qdev->lrg_buf_next_free = 3117 qdev->lrg_buf_next_free = qdev->lrg_buf_q_virt_addr;
3118 (struct bufq_addr_element *)qdev->lrg_buf_q_virt_addr;
3119 qdev->small_buf_index = 0; 3118 qdev->small_buf_index = 0;
3120 qdev->lrg_buf_index = 0; 3119 qdev->lrg_buf_index = 0;
3121 qdev->lrg_buf_free_count = 0; 3120 qdev->lrg_buf_free_count = 0;
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
index bab041a5c758..c77024f90078 100644
--- a/drivers/net/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/qlcnic/qlcnic_ctx.c
@@ -126,7 +126,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
126 err = -EIO; 126 err = -EIO;
127 goto error; 127 goto error;
128 } 128 }
129 tmp_tmpl = (struct qlcnic_dump_template_hdr *) tmp_addr; 129 tmp_tmpl = tmp_addr;
130 csum = qlcnic_temp_checksum((uint32_t *) tmp_addr, temp_size); 130 csum = qlcnic_temp_checksum((uint32_t *) tmp_addr, temp_size);
131 if (csum) { 131 if (csum) {
132 dev_err(&adapter->pdev->dev, 132 dev_err(&adapter->pdev->dev,
@@ -139,7 +139,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
139 err = -EIO; 139 err = -EIO;
140 goto error; 140 goto error;
141 } 141 }
142 tmp_buf = (u32 *) tmp_addr; 142 tmp_buf = tmp_addr;
143 template = (u32 *) ahw->fw_dump.tmpl_hdr; 143 template = (u32 *) ahw->fw_dump.tmpl_hdr;
144 for (i = 0; i < temp_size/sizeof(u32); i++) 144 for (i = 0; i < temp_size/sizeof(u32); i++)
145 *template++ = __le32_to_cpu(*tmp_buf++); 145 *template++ = __le32_to_cpu(*tmp_buf++);
@@ -214,7 +214,7 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
214 &hostrq_phys_addr, GFP_KERNEL); 214 &hostrq_phys_addr, GFP_KERNEL);
215 if (addr == NULL) 215 if (addr == NULL)
216 return -ENOMEM; 216 return -ENOMEM;
217 prq = (struct qlcnic_hostrq_rx_ctx *)addr; 217 prq = addr;
218 218
219 addr = dma_alloc_coherent(&adapter->pdev->dev, rsp_size, 219 addr = dma_alloc_coherent(&adapter->pdev->dev, rsp_size,
220 &cardrsp_phys_addr, GFP_KERNEL); 220 &cardrsp_phys_addr, GFP_KERNEL);
@@ -222,7 +222,7 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
222 err = -ENOMEM; 222 err = -ENOMEM;
223 goto out_free_rq; 223 goto out_free_rq;
224 } 224 }
225 prsp = (struct qlcnic_cardrsp_rx_ctx *)addr; 225 prsp = addr;
226 226
227 prq->host_rsp_dma_addr = cpu_to_le64(cardrsp_phys_addr); 227 prq->host_rsp_dma_addr = cpu_to_le64(cardrsp_phys_addr);
228 228
@@ -380,10 +380,10 @@ qlcnic_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter)
380 } 380 }
381 381
382 memset(rq_addr, 0, rq_size); 382 memset(rq_addr, 0, rq_size);
383 prq = (struct qlcnic_hostrq_tx_ctx *)rq_addr; 383 prq = rq_addr;
384 384
385 memset(rsp_addr, 0, rsp_size); 385 memset(rsp_addr, 0, rsp_size);
386 prsp = (struct qlcnic_cardrsp_tx_ctx *)rsp_addr; 386 prsp = rsp_addr;
387 387
388 prq->host_rsp_dma_addr = cpu_to_le64(rsp_phys_addr); 388 prq->host_rsp_dma_addr = cpu_to_le64(rsp_phys_addr);
389 389
@@ -493,7 +493,7 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
493 goto err_out_free; 493 goto err_out_free;
494 } 494 }
495 495
496 tx_ring->desc_head = (struct cmd_desc_type0 *)addr; 496 tx_ring->desc_head = addr;
497 497
498 for (ring = 0; ring < adapter->max_rds_rings; ring++) { 498 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
499 rds_ring = &recv_ctx->rds_rings[ring]; 499 rds_ring = &recv_ctx->rds_rings[ring];
@@ -506,7 +506,7 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
506 err = -ENOMEM; 506 err = -ENOMEM;
507 goto err_out_free; 507 goto err_out_free;
508 } 508 }
509 rds_ring->desc_head = (struct rcv_desc *)addr; 509 rds_ring->desc_head = addr;
510 510
511 } 511 }
512 512
@@ -522,7 +522,7 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
522 err = -ENOMEM; 522 err = -ENOMEM;
523 goto err_out_free; 523 goto err_out_free;
524 } 524 }
525 sds_ring->desc_head = (struct status_desc *)addr; 525 sds_ring->desc_head = addr;
526 } 526 }
527 527
528 return 0; 528 return 0;
@@ -662,7 +662,7 @@ int qlcnic_get_nic_info(struct qlcnic_adapter *adapter,
662 return -ENOMEM; 662 return -ENOMEM;
663 memset(nic_info_addr, 0, nic_size); 663 memset(nic_info_addr, 0, nic_size);
664 664
665 nic_info = (struct qlcnic_info *) nic_info_addr; 665 nic_info = nic_info_addr;
666 err = qlcnic_issue_cmd(adapter, 666 err = qlcnic_issue_cmd(adapter,
667 adapter->ahw->pci_func, 667 adapter->ahw->pci_func,
668 adapter->fw_hal_version, 668 adapter->fw_hal_version,
@@ -720,7 +720,7 @@ int qlcnic_set_nic_info(struct qlcnic_adapter *adapter, struct qlcnic_info *nic)
720 return -ENOMEM; 720 return -ENOMEM;
721 721
722 memset(nic_info_addr, 0, nic_size); 722 memset(nic_info_addr, 0, nic_size);
723 nic_info = (struct qlcnic_info *)nic_info_addr; 723 nic_info = nic_info_addr;
724 724
725 nic_info->pci_func = cpu_to_le16(nic->pci_func); 725 nic_info->pci_func = cpu_to_le16(nic->pci_func);
726 nic_info->op_mode = cpu_to_le16(nic->op_mode); 726 nic_info->op_mode = cpu_to_le16(nic->op_mode);
@@ -769,7 +769,7 @@ int qlcnic_get_pci_info(struct qlcnic_adapter *adapter,
769 return -ENOMEM; 769 return -ENOMEM;
770 memset(pci_info_addr, 0, pci_size); 770 memset(pci_info_addr, 0, pci_size);
771 771
772 npar = (struct qlcnic_pci_info *) pci_info_addr; 772 npar = pci_info_addr;
773 err = qlcnic_issue_cmd(adapter, 773 err = qlcnic_issue_cmd(adapter,
774 adapter->ahw->pci_func, 774 adapter->ahw->pci_func,
775 adapter->fw_hal_version, 775 adapter->fw_hal_version,
@@ -877,7 +877,7 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
877 QLCNIC_CDRP_CMD_GET_ESWITCH_STATS); 877 QLCNIC_CDRP_CMD_GET_ESWITCH_STATS);
878 878
879 if (!err) { 879 if (!err) {
880 stats = (struct __qlcnic_esw_statistics *)stats_addr; 880 stats = stats_addr;
881 esw_stats->context_id = le16_to_cpu(stats->context_id); 881 esw_stats->context_id = le16_to_cpu(stats->context_id);
882 esw_stats->version = le16_to_cpu(stats->version); 882 esw_stats->version = le16_to_cpu(stats->version);
883 esw_stats->size = le16_to_cpu(stats->size); 883 esw_stats->size = le16_to_cpu(stats->size);
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 9efc690a289f..8ea800192d5d 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -996,7 +996,7 @@ qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
996 /* Copy template header first */ 996 /* Copy template header first */
997 copy_sz = fw_dump->tmpl_hdr->size; 997 copy_sz = fw_dump->tmpl_hdr->size;
998 hdr_ptr = (u32 *) fw_dump->tmpl_hdr; 998 hdr_ptr = (u32 *) fw_dump->tmpl_hdr;
999 data = (u32 *) buffer; 999 data = buffer;
1000 for (i = 0; i < copy_sz/sizeof(u32); i++) 1000 for (i = 0; i < copy_sz/sizeof(u32); i++)
1001 *data++ = cpu_to_le32(*hdr_ptr++); 1001 *data++ = cpu_to_le32(*hdr_ptr++);
1002 1002
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index a5d9fbf9d816..1947f817bf23 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -1673,8 +1673,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
1673 tmpl_hdr->sys_info[1] = adapter->fw_version; 1673 tmpl_hdr->sys_info[1] = adapter->fw_version;
1674 1674
1675 for (i = 0; i < no_entries; i++) { 1675 for (i = 0; i < no_entries; i++) {
1676 entry = (struct qlcnic_dump_entry *) ((void *) tmpl_hdr + 1676 entry = (void *)tmpl_hdr + entry_offset;
1677 entry_offset);
1678 if (!(entry->hdr.mask & tmpl_hdr->drv_cap_mask)) { 1677 if (!(entry->hdr.mask & tmpl_hdr->drv_cap_mask)) {
1679 entry->hdr.flags |= QLCNIC_DUMP_SKIP; 1678 entry->hdr.flags |= QLCNIC_DUMP_SKIP;
1680 entry_offset += entry->hdr.offset; 1679 entry_offset += entry->hdr.offset;
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 0f6af5c61a7c..347a4a8d1267 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1861,7 +1861,7 @@ qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter)
1861 return; 1861 return;
1862 1862
1863 adapter->fhash.fmax = QLCNIC_LB_MAX_FILTERS; 1863 adapter->fhash.fmax = QLCNIC_LB_MAX_FILTERS;
1864 adapter->fhash.fhead = (struct hlist_head *)head; 1864 adapter->fhash.fhead = head;
1865 1865
1866 for (i = 0; i < adapter->fhash.fmax; i++) 1866 for (i = 0; i < adapter->fhash.fmax; i++)
1867 INIT_HLIST_HEAD(&adapter->fhash.fhead[i]); 1867 INIT_HLIST_HEAD(&adapter->fhash.fhead[i]);
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 930ae45457bb..be89610f16a8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3096,7 +3096,7 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
3096 if (rx_ring->lbq_len) { 3096 if (rx_ring->lbq_len) {
3097 cqicb->flags |= FLAGS_LL; /* Load lbq values */ 3097 cqicb->flags |= FLAGS_LL; /* Load lbq values */
3098 tmp = (u64)rx_ring->lbq_base_dma; 3098 tmp = (u64)rx_ring->lbq_base_dma;
3099 base_indirect_ptr = (__le64 *) rx_ring->lbq_base_indirect; 3099 base_indirect_ptr = rx_ring->lbq_base_indirect;
3100 page_entries = 0; 3100 page_entries = 0;
3101 do { 3101 do {
3102 *base_indirect_ptr = cpu_to_le64(tmp); 3102 *base_indirect_ptr = cpu_to_le64(tmp);
@@ -3120,7 +3120,7 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
3120 if (rx_ring->sbq_len) { 3120 if (rx_ring->sbq_len) {
3121 cqicb->flags |= FLAGS_LS; /* Load sbq values */ 3121 cqicb->flags |= FLAGS_LS; /* Load sbq values */
3122 tmp = (u64)rx_ring->sbq_base_dma; 3122 tmp = (u64)rx_ring->sbq_base_dma;
3123 base_indirect_ptr = (__le64 *) rx_ring->sbq_base_indirect; 3123 base_indirect_ptr = rx_ring->sbq_base_indirect;
3124 page_entries = 0; 3124 page_entries = 0;
3125 do { 3125 do {
3126 *base_indirect_ptr = cpu_to_le64(tmp); 3126 *base_indirect_ptr = cpu_to_le64(tmp);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index df0d2c8ecc09..f4d80f9050ef 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -841,7 +841,7 @@ static int init_shared_mem(struct s2io_nic *nic)
841 tmp_p_addr = ring->rx_blocks[j].block_dma_addr; 841 tmp_p_addr = ring->rx_blocks[j].block_dma_addr;
842 tmp_p_addr_next = ring->rx_blocks[next].block_dma_addr; 842 tmp_p_addr_next = ring->rx_blocks[next].block_dma_addr;
843 843
844 pre_rxd_blk = (struct RxD_block *)tmp_v_addr; 844 pre_rxd_blk = tmp_v_addr;
845 pre_rxd_blk->reserved_2_pNext_RxD_block = 845 pre_rxd_blk->reserved_2_pNext_RxD_block =
846 (unsigned long)tmp_v_addr_next; 846 (unsigned long)tmp_v_addr_next;
847 pre_rxd_blk->pNext_RxD_Blk_physical = 847 pre_rxd_blk->pNext_RxD_Blk_physical =
@@ -918,7 +918,7 @@ static int init_shared_mem(struct s2io_nic *nic)
918 mac_control->stats_mem_sz = size; 918 mac_control->stats_mem_sz = size;
919 919
920 tmp_v_addr = mac_control->stats_mem; 920 tmp_v_addr = mac_control->stats_mem;
921 mac_control->stats_info = (struct stat_block *)tmp_v_addr; 921 mac_control->stats_info = tmp_v_addr;
922 memset(tmp_v_addr, 0, size); 922 memset(tmp_v_addr, 0, size);
923 DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n", 923 DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n",
924 dev_name(&nic->pdev->dev), (unsigned long long)tmp_p_addr); 924 dev_name(&nic->pdev->dev), (unsigned long long)tmp_p_addr);
@@ -2439,7 +2439,7 @@ static void free_tx_buffers(struct s2io_nic *nic)
2439 2439
2440 spin_lock_irqsave(&fifo->tx_lock, flags); 2440 spin_lock_irqsave(&fifo->tx_lock, flags);
2441 for (j = 0; j < tx_cfg->fifo_len; j++) { 2441 for (j = 0; j < tx_cfg->fifo_len; j++) {
2442 txdp = (struct TxD *)fifo->list_info[j].list_virt_addr; 2442 txdp = fifo->list_info[j].list_virt_addr;
2443 skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); 2443 skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j);
2444 if (skb) { 2444 if (skb) {
2445 swstats->mem_freed += skb->truesize; 2445 swstats->mem_freed += skb->truesize;
@@ -3075,8 +3075,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
3075 3075
3076 get_info = fifo_data->tx_curr_get_info; 3076 get_info = fifo_data->tx_curr_get_info;
3077 memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info)); 3077 memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info));
3078 txdlp = (struct TxD *) 3078 txdlp = fifo_data->list_info[get_info.offset].list_virt_addr;
3079 fifo_data->list_info[get_info.offset].list_virt_addr;
3080 while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) && 3079 while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&
3081 (get_info.offset != put_info.offset) && 3080 (get_info.offset != put_info.offset) &&
3082 (txdlp->Host_Control)) { 3081 (txdlp->Host_Control)) {
@@ -3129,8 +3128,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
3129 get_info.offset++; 3128 get_info.offset++;
3130 if (get_info.offset == get_info.fifo_len + 1) 3129 if (get_info.offset == get_info.fifo_len + 1)
3131 get_info.offset = 0; 3130 get_info.offset = 0;
3132 txdlp = (struct TxD *) 3131 txdlp = fifo_data->list_info[get_info.offset].list_virt_addr;
3133 fifo_data->list_info[get_info.offset].list_virt_addr;
3134 fifo_data->tx_curr_get_info.offset = get_info.offset; 3132 fifo_data->tx_curr_get_info.offset = get_info.offset;
3135 } 3133 }
3136 3134
@@ -4163,7 +4161,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4163 4161
4164 put_off = (u16)fifo->tx_curr_put_info.offset; 4162 put_off = (u16)fifo->tx_curr_put_info.offset;
4165 get_off = (u16)fifo->tx_curr_get_info.offset; 4163 get_off = (u16)fifo->tx_curr_get_info.offset;
4166 txdp = (struct TxD *)fifo->list_info[put_off].list_virt_addr; 4164 txdp = fifo->list_info[put_off].list_virt_addr;
4167 4165
4168 queue_len = fifo->tx_curr_put_info.fifo_len + 1; 4166 queue_len = fifo->tx_curr_put_info.fifo_len + 1;
4169 /* Avoid "put" pointer going beyond "get" pointer */ 4167 /* Avoid "put" pointer going beyond "get" pointer */
@@ -7972,9 +7970,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7972 7970
7973 /* Initializing the BAR1 address as the start of the FIFO pointer. */ 7971 /* Initializing the BAR1 address as the start of the FIFO pointer. */
7974 for (j = 0; j < MAX_TX_FIFOS; j++) { 7972 for (j = 0; j < MAX_TX_FIFOS; j++) {
7975 mac_control->tx_FIFO_start[j] = 7973 mac_control->tx_FIFO_start[j] = sp->bar1 + (j * 0x00020000);
7976 (struct TxFIFO_element __iomem *)
7977 (sp->bar1 + (j * 0x00020000));
7978 } 7974 }
7979 7975
7980 /* Driver entry points */ 7976 /* Driver entry points */
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index fb4721f780ff..a66818ed4011 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -400,7 +400,7 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)
400 u64 generation_end; 400 u64 generation_end;
401 401
402 mac_stats = &efx->mac_stats; 402 mac_stats = &efx->mac_stats;
403 dma_stats = (u64 *)efx->stats_buffer.addr; 403 dma_stats = efx->stats_buffer.addr;
404 404
405 generation_end = dma_stats[MC_CMD_MAC_GENERATION_END]; 405 generation_end = dma_stats[MC_CMD_MAC_GENERATION_END];
406 if (generation_end == STATS_GENERATION_INVALID) 406 if (generation_end == STATS_GENERATION_INVALID)
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 484f795a779d..658a1928fe79 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -482,7 +482,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
482 ret = -ENOMEM; 482 ret = -ENOMEM;
483 goto err_out_cleardev; 483 goto err_out_cleardev;
484 } 484 }
485 sis_priv->tx_ring = (BufferDesc *)ring_space; 485 sis_priv->tx_ring = ring_space;
486 sis_priv->tx_ring_dma = ring_dma; 486 sis_priv->tx_ring_dma = ring_dma;
487 487
488 ring_space = pci_alloc_consistent(pci_dev, RX_TOTAL_SIZE, &ring_dma); 488 ring_space = pci_alloc_consistent(pci_dev, RX_TOTAL_SIZE, &ring_dma);
@@ -490,7 +490,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
490 ret = -ENOMEM; 490 ret = -ENOMEM;
491 goto err_unmap_tx; 491 goto err_unmap_tx;
492 } 492 }
493 sis_priv->rx_ring = (BufferDesc *)ring_space; 493 sis_priv->rx_ring = ring_space;
494 sis_priv->rx_ring_dma = ring_dma; 494 sis_priv->rx_ring_dma = ring_dma;
495 495
496 /* The SiS900-specific entries in the device structure. */ 496 /* The SiS900-specific entries in the device structure. */
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 2bedc0ace812..6153cfd696b6 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -418,7 +418,7 @@ static irqreturn_t madgemc_interrupt(int irq, void *dev_id)
418 return IRQ_NONE; 418 return IRQ_NONE;
419 } 419 }
420 420
421 dev = (struct net_device *)dev_id; 421 dev = dev_id;
422 422
423 /* Make sure its really us. -- the Madge way */ 423 /* Make sure its really us. -- the Madge way */
424 pending = inb(dev->base_addr + MC_CONTROL_REG0); 424 pending = inb(dev->base_addr + MC_CONTROL_REG0);
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 3de4283344e9..1d5091a1e49a 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -2367,7 +2367,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2367 2367
2368 dev->irq = pdev->irq; 2368 dev->irq = pdev->irq;
2369 tp = netdev_priv(dev); 2369 tp = netdev_priv(dev);
2370 tp->shared = (struct typhoon_shared *) shared; 2370 tp->shared = shared;
2371 tp->shared_dma = shared_dma; 2371 tp->shared_dma = shared_dma;
2372 tp->pdev = pdev; 2372 tp->pdev = pdev;
2373 tp->tx_pdev = pdev; 2373 tp->tx_pdev = pdev;
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 32763b2dd73f..857618afa147 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -582,7 +582,7 @@ __vxge_hw_device_toc_get(void __iomem *bar0)
582 goto exit; 582 goto exit;
583 583
584 val64 = readq(&legacy_reg->toc_first_pointer); 584 val64 = readq(&legacy_reg->toc_first_pointer);
585 toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64); 585 toc = bar0 + val64;
586exit: 586exit:
587 return toc; 587 return toc;
588} 588}
@@ -600,7 +600,7 @@ __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
600 u32 i; 600 u32 i;
601 enum vxge_hw_status status = VXGE_HW_OK; 601 enum vxge_hw_status status = VXGE_HW_OK;
602 602
603 hldev->legacy_reg = (struct vxge_hw_legacy_reg __iomem *)hldev->bar0; 603 hldev->legacy_reg = hldev->bar0;
604 604
605 hldev->toc_reg = __vxge_hw_device_toc_get(hldev->bar0); 605 hldev->toc_reg = __vxge_hw_device_toc_get(hldev->bar0);
606 if (hldev->toc_reg == NULL) { 606 if (hldev->toc_reg == NULL) {
@@ -609,39 +609,31 @@ __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
609 } 609 }
610 610
611 val64 = readq(&hldev->toc_reg->toc_common_pointer); 611 val64 = readq(&hldev->toc_reg->toc_common_pointer);
612 hldev->common_reg = 612 hldev->common_reg = hldev->bar0 + val64;
613 (struct vxge_hw_common_reg __iomem *)(hldev->bar0 + val64);
614 613
615 val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer); 614 val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer);
616 hldev->mrpcim_reg = 615 hldev->mrpcim_reg = hldev->bar0 + val64;
617 (struct vxge_hw_mrpcim_reg __iomem *)(hldev->bar0 + val64);
618 616
619 for (i = 0; i < VXGE_HW_TITAN_SRPCIM_REG_SPACES; i++) { 617 for (i = 0; i < VXGE_HW_TITAN_SRPCIM_REG_SPACES; i++) {
620 val64 = readq(&hldev->toc_reg->toc_srpcim_pointer[i]); 618 val64 = readq(&hldev->toc_reg->toc_srpcim_pointer[i]);
621 hldev->srpcim_reg[i] = 619 hldev->srpcim_reg[i] = hldev->bar0 + val64;
622 (struct vxge_hw_srpcim_reg __iomem *)
623 (hldev->bar0 + val64);
624 } 620 }
625 621
626 for (i = 0; i < VXGE_HW_TITAN_VPMGMT_REG_SPACES; i++) { 622 for (i = 0; i < VXGE_HW_TITAN_VPMGMT_REG_SPACES; i++) {
627 val64 = readq(&hldev->toc_reg->toc_vpmgmt_pointer[i]); 623 val64 = readq(&hldev->toc_reg->toc_vpmgmt_pointer[i]);
628 hldev->vpmgmt_reg[i] = 624 hldev->vpmgmt_reg[i] = hldev->bar0 + val64;
629 (struct vxge_hw_vpmgmt_reg __iomem *)(hldev->bar0 + val64);
630 } 625 }
631 626
632 for (i = 0; i < VXGE_HW_TITAN_VPATH_REG_SPACES; i++) { 627 for (i = 0; i < VXGE_HW_TITAN_VPATH_REG_SPACES; i++) {
633 val64 = readq(&hldev->toc_reg->toc_vpath_pointer[i]); 628 val64 = readq(&hldev->toc_reg->toc_vpath_pointer[i]);
634 hldev->vpath_reg[i] = 629 hldev->vpath_reg[i] = hldev->bar0 + val64;
635 (struct vxge_hw_vpath_reg __iomem *)
636 (hldev->bar0 + val64);
637 } 630 }
638 631
639 val64 = readq(&hldev->toc_reg->toc_kdfc); 632 val64 = readq(&hldev->toc_reg->toc_kdfc);
640 633
641 switch (VXGE_HW_TOC_GET_KDFC_INITIAL_BIR(val64)) { 634 switch (VXGE_HW_TOC_GET_KDFC_INITIAL_BIR(val64)) {
642 case 0: 635 case 0:
643 hldev->kdfc = (u8 __iomem *)(hldev->bar0 + 636 hldev->kdfc = hldev->bar0 + VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64) ;
644 VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64));
645 break; 637 break;
646 default: 638 default:
647 break; 639 break;
@@ -1024,7 +1016,7 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
1024 } 1016 }
1025 1017
1026 val64 = readq(&toc->toc_common_pointer); 1018 val64 = readq(&toc->toc_common_pointer);
1027 common_reg = (struct vxge_hw_common_reg __iomem *)(bar0 + val64); 1019 common_reg = bar0 + val64;
1028 1020
1029 status = __vxge_hw_device_vpath_reset_in_prog_check( 1021 status = __vxge_hw_device_vpath_reset_in_prog_check(
1030 (u64 __iomem *)&common_reg->vpath_rst_in_prog); 1022 (u64 __iomem *)&common_reg->vpath_rst_in_prog);
@@ -1044,8 +1036,7 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
1044 1036
1045 val64 = readq(&toc->toc_vpmgmt_pointer[i]); 1037 val64 = readq(&toc->toc_vpmgmt_pointer[i]);
1046 1038
1047 vpmgmt_reg = (struct vxge_hw_vpmgmt_reg __iomem *) 1039 vpmgmt_reg = bar0 + val64;
1048 (bar0 + val64);
1049 1040
1050 hw_info->func_id = __vxge_hw_vpath_func_id_get(vpmgmt_reg); 1041 hw_info->func_id = __vxge_hw_vpath_func_id_get(vpmgmt_reg);
1051 if (__vxge_hw_device_access_rights_get(hw_info->host_type, 1042 if (__vxge_hw_device_access_rights_get(hw_info->host_type,
@@ -1054,8 +1045,7 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
1054 1045
1055 val64 = readq(&toc->toc_mrpcim_pointer); 1046 val64 = readq(&toc->toc_mrpcim_pointer);
1056 1047
1057 mrpcim_reg = (struct vxge_hw_mrpcim_reg __iomem *) 1048 mrpcim_reg = bar0 + val64;
1058 (bar0 + val64);
1059 1049
1060 writeq(0, &mrpcim_reg->xgmac_gen_fw_memo_mask); 1050 writeq(0, &mrpcim_reg->xgmac_gen_fw_memo_mask);
1061 wmb(); 1051 wmb();
@@ -1064,8 +1054,7 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
1064 val64 = readq(&toc->toc_vpath_pointer[i]); 1054 val64 = readq(&toc->toc_vpath_pointer[i]);
1065 1055
1066 spin_lock_init(&vpath.lock); 1056 spin_lock_init(&vpath.lock);
1067 vpath.vp_reg = (struct vxge_hw_vpath_reg __iomem *) 1057 vpath.vp_reg = bar0 + val64;
1068 (bar0 + val64);
1069 vpath.vp_open = VXGE_HW_VP_NOT_OPEN; 1058 vpath.vp_open = VXGE_HW_VP_NOT_OPEN;
1070 1059
1071 status = __vxge_hw_vpath_pci_func_mode_get(&vpath, hw_info); 1060 status = __vxge_hw_vpath_pci_func_mode_get(&vpath, hw_info);
@@ -1088,8 +1077,7 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
1088 continue; 1077 continue;
1089 1078
1090 val64 = readq(&toc->toc_vpath_pointer[i]); 1079 val64 = readq(&toc->toc_vpath_pointer[i]);
1091 vpath.vp_reg = (struct vxge_hw_vpath_reg __iomem *) 1080 vpath.vp_reg = bar0 + val64;
1092 (bar0 + val64);
1093 vpath.vp_open = VXGE_HW_VP_NOT_OPEN; 1081 vpath.vp_open = VXGE_HW_VP_NOT_OPEN;
1094 1082
1095 status = __vxge_hw_vpath_addr_get(&vpath, 1083 status = __vxge_hw_vpath_addr_get(&vpath,
@@ -2140,8 +2128,7 @@ __vxge_hw_ring_mempool_item_alloc(struct vxge_hw_mempool *mempoolh,
2140 memblock_index, item, 2128 memblock_index, item,
2141 &memblock_item_idx); 2129 &memblock_item_idx);
2142 2130
2143 rxdp = (struct vxge_hw_ring_rxd_1 *) 2131 rxdp = ring->channel.reserve_arr[reserve_index];
2144 ring->channel.reserve_arr[reserve_index];
2145 2132
2146 uld_priv = ((u8 *)rxdblock_priv + ring->rxd_priv_size * i); 2133 uld_priv = ((u8 *)rxdblock_priv + ring->rxd_priv_size * i);
2147 2134
@@ -4880,8 +4867,7 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev,
4880 goto vpath_open_exit8; 4867 goto vpath_open_exit8;
4881 } 4868 }
4882 4869
4883 vpath->hw_stats = (struct vxge_hw_vpath_stats_hw_info *)vpath-> 4870 vpath->hw_stats = vpath->stats_block->memblock;
4884 stats_block->memblock;
4885 memset(vpath->hw_stats, 0, 4871 memset(vpath->hw_stats, 0,
4886 sizeof(struct vxge_hw_vpath_stats_hw_info)); 4872 sizeof(struct vxge_hw_vpath_stats_hw_info));
4887 4873
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index f93517055162..ad64ce0afe3f 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -1309,7 +1309,7 @@ enum vxge_hw_status vxge_hw_ring_rxd_next_completed(
1309 1309
1310 vxge_hw_channel_dtr_try_complete(channel, rxdh); 1310 vxge_hw_channel_dtr_try_complete(channel, rxdh);
1311 1311
1312 rxdp = (struct vxge_hw_ring_rxd_1 *)*rxdh; 1312 rxdp = *rxdh;
1313 if (rxdp == NULL) { 1313 if (rxdp == NULL) {
1314 status = VXGE_HW_INF_NO_MORE_COMPLETED_DESCRIPTORS; 1314 status = VXGE_HW_INF_NO_MORE_COMPLETED_DESCRIPTORS;
1315 goto exit; 1315 goto exit;
@@ -1565,7 +1565,7 @@ void vxge_hw_fifo_txdl_post(struct __vxge_hw_fifo *fifo, void *txdlh)
1565 channel = &fifo->channel; 1565 channel = &fifo->channel;
1566 1566
1567 txdl_priv = __vxge_hw_fifo_txdl_priv(fifo, txdlh); 1567 txdl_priv = __vxge_hw_fifo_txdl_priv(fifo, txdlh);
1568 txdp_first = (struct vxge_hw_fifo_txd *)txdlh; 1568 txdp_first = txdlh;
1569 1569
1570 txdp_last = (struct vxge_hw_fifo_txd *)txdlh + (txdl_priv->frags - 1); 1570 txdp_last = (struct vxge_hw_fifo_txd *)txdlh + (txdl_priv->frags - 1);
1571 txdp_last->control_0 |= 1571 txdp_last->control_0 |=
@@ -1631,7 +1631,7 @@ enum vxge_hw_status vxge_hw_fifo_txdl_next_completed(
1631 1631
1632 vxge_hw_channel_dtr_try_complete(channel, txdlh); 1632 vxge_hw_channel_dtr_try_complete(channel, txdlh);
1633 1633
1634 txdp = (struct vxge_hw_fifo_txd *)*txdlh; 1634 txdp = *txdlh;
1635 if (txdp == NULL) { 1635 if (txdp == NULL) {
1636 status = VXGE_HW_INF_NO_MORE_COMPLETED_DESCRIPTORS; 1636 status = VXGE_HW_INF_NO_MORE_COMPLETED_DESCRIPTORS;
1637 goto exit; 1637 goto exit;
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 1c65d1c33873..d47d2cd10475 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -755,7 +755,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
755 755
756 dsr_rx = cpc_readb(card->hw.scabase + DSR_RX(ch)); 756 dsr_rx = cpc_readb(card->hw.scabase + DSR_RX(ch));
757 757
758 cpc_tty = (st_cpc_tty_area *)pc300dev->cpc_tty; 758 cpc_tty = pc300dev->cpc_tty;
759 759
760 while (1) { 760 while (1) {
761 rx_len = 0; 761 rx_len = 0;
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 039d976ba313..8018d7d045b0 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -252,11 +252,11 @@ static void xemaclite_aligned_write(void *src_ptr, u32 *dest_ptr,
252 u16 *from_u16_ptr, *to_u16_ptr; 252 u16 *from_u16_ptr, *to_u16_ptr;
253 253
254 to_u32_ptr = dest_ptr; 254 to_u32_ptr = dest_ptr;
255 from_u16_ptr = (u16 *) src_ptr; 255 from_u16_ptr = src_ptr;
256 align_buffer = 0; 256 align_buffer = 0;
257 257
258 for (; length > 3; length -= 4) { 258 for (; length > 3; length -= 4) {
259 to_u16_ptr = (u16 *) ((void *) &align_buffer); 259 to_u16_ptr = (u16 *)&align_buffer;
260 *to_u16_ptr++ = *from_u16_ptr++; 260 *to_u16_ptr++ = *from_u16_ptr++;
261 *to_u16_ptr++ = *from_u16_ptr++; 261 *to_u16_ptr++ = *from_u16_ptr++;
262 262
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index ec47e22fa186..3e5ac60b89ac 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -442,19 +442,19 @@ static int __devinit yellowfin_init_one(struct pci_dev *pdev,
442 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma); 442 ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, &ring_dma);
443 if (!ring_space) 443 if (!ring_space)
444 goto err_out_cleardev; 444 goto err_out_cleardev;
445 np->tx_ring = (struct yellowfin_desc *)ring_space; 445 np->tx_ring = ring_space;
446 np->tx_ring_dma = ring_dma; 446 np->tx_ring_dma = ring_dma;
447 447
448 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma); 448 ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, &ring_dma);
449 if (!ring_space) 449 if (!ring_space)
450 goto err_out_unmap_tx; 450 goto err_out_unmap_tx;
451 np->rx_ring = (struct yellowfin_desc *)ring_space; 451 np->rx_ring = ring_space;
452 np->rx_ring_dma = ring_dma; 452 np->rx_ring_dma = ring_dma;
453 453
454 ring_space = pci_alloc_consistent(pdev, STATUS_TOTAL_SIZE, &ring_dma); 454 ring_space = pci_alloc_consistent(pdev, STATUS_TOTAL_SIZE, &ring_dma);
455 if (!ring_space) 455 if (!ring_space)
456 goto err_out_unmap_rx; 456 goto err_out_unmap_rx;
457 np->tx_status = (struct tx_status_words *)ring_space; 457 np->tx_status = ring_space;
458 np->tx_status_dma = ring_dma; 458 np->tx_status_dma = ring_dma;
459 459
460 if (dev->mem_start) 460 if (dev->mem_start)