aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-06-04 08:44:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-06 12:31:33 -0400
commitc2fd03a0115a244c5f622453b2b1f038ed5700a6 (patch)
tree55c6a15e0ab898f15b08dfe4dcba4db55dc2af9b /drivers/net
parent2c208890c6d4e16076c6664137703ec813e8fa6c (diff)
drivers: net: Remove casts to same type
Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force, __iomem and __user. @@ type T; T *p; @@ - (T *)p + p Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/appletalk/cops.c2
-rw-r--r--drivers/net/can/bfin_can.c2
-rw-r--r--drivers/net/can/mcp251x.c3
-rw-r--r--drivers/net/fddi/defxx.c4
-rw-r--r--drivers/net/fddi/skfp/pmf.c8
-rw-r--r--drivers/net/hamradio/mkiss.c8
-rw-r--r--drivers/net/hyperv/netvsc.c2
-rw-r--r--drivers/net/irda/ali-ircc.c6
-rw-r--r--drivers/net/irda/au1k_ir.c2
-rw-r--r--drivers/net/slip/slip.c4
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c2
-rw-r--r--drivers/net/wan/x25_asy.c2
-rw-r--r--drivers/net/wimax/i2400m/fw.c2
13 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index dd5e04813b76..545c09ed9079 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -936,7 +936,7 @@ static int cops_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
936{ 936{
937 struct cops_local *lp = netdev_priv(dev); 937 struct cops_local *lp = netdev_priv(dev);
938 struct sockaddr_at *sa = (struct sockaddr_at *)&ifr->ifr_addr; 938 struct sockaddr_at *sa = (struct sockaddr_at *)&ifr->ifr_addr;
939 struct atalk_addr *aa = (struct atalk_addr *)&lp->node_addr; 939 struct atalk_addr *aa = &lp->node_addr;
940 940
941 switch(cmd) 941 switch(cmd)
942 { 942 {
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 3f88473423e9..ea3143895e6d 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -597,7 +597,7 @@ static int __devinit bfin_can_probe(struct platform_device *pdev)
597 dev_info(&pdev->dev, 597 dev_info(&pdev->dev,
598 "%s device registered" 598 "%s device registered"
599 "(&reg_base=%p, rx_irq=%d, tx_irq=%d, err_irq=%d, sclk=%d)\n", 599 "(&reg_base=%p, rx_irq=%d, tx_irq=%d, err_irq=%d, sclk=%d)\n",
600 DRV_NAME, (void *)priv->membase, priv->rx_irq, 600 DRV_NAME, priv->membase, priv->rx_irq,
601 priv->tx_irq, priv->err_irq, priv->can.clock.freq); 601 priv->tx_irq, priv->err_irq, priv->can.clock.freq);
602 return 0; 602 return 0;
603 603
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 346785c56a25..9120a36ec702 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -1020,8 +1020,7 @@ static int __devinit mcp251x_can_probe(struct spi_device *spi)
1020 GFP_DMA); 1020 GFP_DMA);
1021 1021
1022 if (priv->spi_tx_buf) { 1022 if (priv->spi_tx_buf) {
1023 priv->spi_rx_buf = (u8 *)(priv->spi_tx_buf + 1023 priv->spi_rx_buf = (priv->spi_tx_buf + (PAGE_SIZE / 2));
1024 (PAGE_SIZE / 2));
1025 priv->spi_rx_dma = (dma_addr_t)(priv->spi_tx_dma + 1024 priv->spi_rx_dma = (dma_addr_t)(priv->spi_tx_dma +
1026 (PAGE_SIZE / 2)); 1025 (PAGE_SIZE / 2));
1027 } else { 1026 } else {
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 4ad80f771099..6695a1dadf4e 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -2962,7 +2962,7 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers)
2962 bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP | 2962 bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
2963 ((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN)); 2963 ((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN));
2964 bp->descr_block_virt->rcv_data[i+j].long_1 = (u32) (bp->rcv_block_phys + (i * PI_RCV_DATA_K_SIZE_MAX)); 2964 bp->descr_block_virt->rcv_data[i+j].long_1 = (u32) (bp->rcv_block_phys + (i * PI_RCV_DATA_K_SIZE_MAX));
2965 bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX)); 2965 bp->p_rcv_buff_va[i+j] = (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX));
2966 } 2966 }
2967#endif 2967#endif
2968 } 2968 }
@@ -3030,7 +3030,7 @@ static void dfx_rcv_queue_process(
3030#ifdef DYNAMIC_BUFFERS 3030#ifdef DYNAMIC_BUFFERS
3031 p_buff = (char *) (((struct sk_buff *)bp->p_rcv_buff_va[entry])->data); 3031 p_buff = (char *) (((struct sk_buff *)bp->p_rcv_buff_va[entry])->data);
3032#else 3032#else
3033 p_buff = (char *) bp->p_rcv_buff_va[entry]; 3033 p_buff = bp->p_rcv_buff_va[entry];
3034#endif 3034#endif
3035 memcpy(&descr, p_buff + RCV_BUFF_K_DESCR, sizeof(u32)); 3035 memcpy(&descr, p_buff + RCV_BUFF_K_DESCR, sizeof(u32));
3036 3036
diff --git a/drivers/net/fddi/skfp/pmf.c b/drivers/net/fddi/skfp/pmf.c
index 9ac4665d7411..24d8566cfd8b 100644
--- a/drivers/net/fddi/skfp/pmf.c
+++ b/drivers/net/fddi/skfp/pmf.c
@@ -1242,7 +1242,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1242 if (len < 8) 1242 if (len < 8)
1243 goto len_error ; 1243 goto len_error ;
1244 if (set) 1244 if (set)
1245 memcpy((char *) to,(char *) from+2,6) ; 1245 memcpy(to,from+2,6) ;
1246 to += 8 ; 1246 to += 8 ;
1247 from += 8 ; 1247 from += 8 ;
1248 len -= 8 ; 1248 len -= 8 ;
@@ -1251,7 +1251,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1251 if (len < 4) 1251 if (len < 4)
1252 goto len_error ; 1252 goto len_error ;
1253 if (set) 1253 if (set)
1254 memcpy((char *) to,(char *) from,4) ; 1254 memcpy(to,from,4) ;
1255 to += 4 ; 1255 to += 4 ;
1256 from += 4 ; 1256 from += 4 ;
1257 len -= 4 ; 1257 len -= 4 ;
@@ -1260,7 +1260,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1260 if (len < 8) 1260 if (len < 8)
1261 goto len_error ; 1261 goto len_error ;
1262 if (set) 1262 if (set)
1263 memcpy((char *) to,(char *) from,8) ; 1263 memcpy(to,from,8) ;
1264 to += 8 ; 1264 to += 8 ;
1265 from += 8 ; 1265 from += 8 ;
1266 len -= 8 ; 1266 len -= 8 ;
@@ -1269,7 +1269,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1269 if (len < 32) 1269 if (len < 32)
1270 goto len_error ; 1270 goto len_error ;
1271 if (set) 1271 if (set)
1272 memcpy((char *) to,(char *) from,32) ; 1272 memcpy(to,from,32) ;
1273 to += 32 ; 1273 to += 32 ;
1274 from += 32 ; 1274 from += 32 ;
1275 len -= 32 ; 1275 len -= 32 ;
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index aed1a6105b24..2c0894a92abd 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -485,7 +485,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
485 485
486 return; 486 return;
487 default: 487 default:
488 count = kiss_esc(p, (unsigned char *)ax->xbuff, len); 488 count = kiss_esc(p, ax->xbuff, len);
489 } 489 }
490 } else { 490 } else {
491 unsigned short crc; 491 unsigned short crc;
@@ -497,7 +497,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
497 case CRC_MODE_SMACK: 497 case CRC_MODE_SMACK:
498 *p |= 0x80; 498 *p |= 0x80;
499 crc = swab16(crc16(0, p, len)); 499 crc = swab16(crc16(0, p, len));
500 count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); 500 count = kiss_esc_crc(p, ax->xbuff, crc, len+2);
501 break; 501 break;
502 case CRC_MODE_FLEX_TEST: 502 case CRC_MODE_FLEX_TEST:
503 ax->crcmode = CRC_MODE_NONE; 503 ax->crcmode = CRC_MODE_NONE;
@@ -506,11 +506,11 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
506 case CRC_MODE_FLEX: 506 case CRC_MODE_FLEX:
507 *p |= 0x20; 507 *p |= 0x20;
508 crc = calc_crc_flex(p, len); 508 crc = calc_crc_flex(p, len);
509 count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); 509 count = kiss_esc_crc(p, ax->xbuff, crc, len+2);
510 break; 510 break;
511 511
512 default: 512 default:
513 count = kiss_esc(p, (unsigned char *)ax->xbuff, len); 513 count = kiss_esc(p, ax->xbuff, len);
514 } 514 }
515 } 515 }
516 spin_unlock_bh(&ax->buflock); 516 spin_unlock_bh(&ax->buflock);
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 8b919471472f..4363c76e0d63 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -614,7 +614,7 @@ retry_send_cmplt:
614static void netvsc_receive_completion(void *context) 614static void netvsc_receive_completion(void *context)
615{ 615{
616 struct hv_netvsc_packet *packet = context; 616 struct hv_netvsc_packet *packet = context;
617 struct hv_device *device = (struct hv_device *)packet->device; 617 struct hv_device *device = packet->device;
618 struct netvsc_device *net_device; 618 struct netvsc_device *net_device;
619 u64 transaction_id = 0; 619 u64 transaction_id = 0;
620 bool fsend_receive_comp = false; 620 bool fsend_receive_comp = false;
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index dcc80d652b78..84872043b5c6 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -1017,7 +1017,7 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud)
1017{ 1017{
1018 1018
1019 int iobase; 1019 int iobase;
1020 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; 1020 struct ali_ircc_cb *self = priv;
1021 struct net_device *dev; 1021 struct net_device *dev;
1022 1022
1023 IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); 1023 IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ );
@@ -1052,7 +1052,7 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud)
1052 */ 1052 */
1053static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed) 1053static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
1054{ 1054{
1055 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; 1055 struct ali_ircc_cb *self = priv;
1056 unsigned long flags; 1056 unsigned long flags;
1057 int iobase; 1057 int iobase;
1058 int fcr; /* FIFO control reg */ 1058 int fcr; /* FIFO control reg */
@@ -1121,7 +1121,7 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
1121static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed) 1121static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed)
1122{ 1122{
1123 1123
1124 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; 1124 struct ali_ircc_cb *self = priv;
1125 int iobase,dongle_id; 1125 int iobase,dongle_id;
1126 int tmp = 0; 1126 int tmp = 0;
1127 1127
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index fc503aa5288e..e09417df8f39 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -794,7 +794,7 @@ static int __devinit au1k_irda_net_init(struct net_device *dev)
794 794
795 /* allocate the data buffers */ 795 /* allocate the data buffers */
796 aup->db[0].vaddr = 796 aup->db[0].vaddr =
797 (void *)dma_alloc(MAX_BUF_SIZE * 2 * NUM_IR_DESC, &temp); 797 dma_alloc(MAX_BUF_SIZE * 2 * NUM_IR_DESC, &temp);
798 if (!aup->db[0].vaddr) 798 if (!aup->db[0].vaddr)
799 goto out3; 799 goto out3;
800 800
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index d4c9db3da22a..a34d6bf5e43b 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -390,10 +390,10 @@ static void sl_encaps(struct slip *sl, unsigned char *icp, int len)
390#endif 390#endif
391#ifdef CONFIG_SLIP_MODE_SLIP6 391#ifdef CONFIG_SLIP_MODE_SLIP6
392 if (sl->mode & SL_MODE_SLIP6) 392 if (sl->mode & SL_MODE_SLIP6)
393 count = slip_esc6(p, (unsigned char *) sl->xbuff, len); 393 count = slip_esc6(p, sl->xbuff, len);
394 else 394 else
395#endif 395#endif
396 count = slip_esc(p, (unsigned char *) sl->xbuff, len); 396 count = slip_esc(p, sl->xbuff, len);
397 397
398 /* Order of next two lines is *very* important. 398 /* Order of next two lines is *very* important.
399 * When we are sending a little amount of data, 399 * When we are sending a little amount of data,
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 3f04ba0a5454..93e0cfb739b8 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1037,7 +1037,7 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
1037#endif 1037#endif
1038 dev_dbg(&adapter->netdev->dev, 1038 dev_dbg(&adapter->netdev->dev,
1039 "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n", 1039 "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n",
1040 (u32)((union Vmxnet3_GenericDesc *)ctx.sop_txd - 1040 (u32)(ctx.sop_txd -
1041 tq->tx_ring.base), le64_to_cpu(gdesc->txd.addr), 1041 tq->tx_ring.base), le64_to_cpu(gdesc->txd.addr),
1042 le32_to_cpu(gdesc->dword[2]), le32_to_cpu(gdesc->dword[3])); 1042 le32_to_cpu(gdesc->dword[2]), le32_to_cpu(gdesc->dword[3]));
1043 1043
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index d7a65e141d1a..44db8b75a531 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -231,7 +231,7 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len)
231 } 231 }
232 232
233 p = icp; 233 p = icp;
234 count = x25_asy_esc(p, (unsigned char *) sl->xbuff, len); 234 count = x25_asy_esc(p, sl->xbuff, len);
235 235
236 /* Order of next two lines is *very* important. 236 /* Order of next two lines is *very* important.
237 * When we are sending a little amount of data, 237 * When we are sending a little amount of data,
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index 7cbd7d231e11..d09e44970e63 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -1268,7 +1268,7 @@ int i2400m_fw_check(struct i2400m *i2400m, const void *bcf, size_t bcf_size)
1268 size_t leftover, offset, header_len, size; 1268 size_t leftover, offset, header_len, size;
1269 1269
1270 leftover = top - itr; 1270 leftover = top - itr;
1271 offset = itr - (const void *) bcf; 1271 offset = itr - bcf;
1272 if (leftover <= sizeof(*bcf_hdr)) { 1272 if (leftover <= sizeof(*bcf_hdr)) {
1273 dev_err(dev, "firmware %s: %zu B left at @%zx, " 1273 dev_err(dev, "firmware %s: %zu B left at @%zx, "
1274 "not enough for BCF header\n", 1274 "not enough for BCF header\n",