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>
This commit is contained in:

committed by
David S. Miller

parent
2c208890c6
commit
c2fd03a011
@@ -2962,7 +2962,7 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers)
|
||||
bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
|
||||
((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN));
|
||||
bp->descr_block_virt->rcv_data[i+j].long_1 = (u32) (bp->rcv_block_phys + (i * PI_RCV_DATA_K_SIZE_MAX));
|
||||
bp->p_rcv_buff_va[i+j] = (char *) (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX));
|
||||
bp->p_rcv_buff_va[i+j] = (bp->rcv_block_virt + (i * PI_RCV_DATA_K_SIZE_MAX));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3030,7 +3030,7 @@ static void dfx_rcv_queue_process(
|
||||
#ifdef DYNAMIC_BUFFERS
|
||||
p_buff = (char *) (((struct sk_buff *)bp->p_rcv_buff_va[entry])->data);
|
||||
#else
|
||||
p_buff = (char *) bp->p_rcv_buff_va[entry];
|
||||
p_buff = bp->p_rcv_buff_va[entry];
|
||||
#endif
|
||||
memcpy(&descr, p_buff + RCV_BUFF_K_DESCR, sizeof(u32));
|
||||
|
||||
|
@@ -1242,7 +1242,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
|
||||
if (len < 8)
|
||||
goto len_error ;
|
||||
if (set)
|
||||
memcpy((char *) to,(char *) from+2,6) ;
|
||||
memcpy(to,from+2,6) ;
|
||||
to += 8 ;
|
||||
from += 8 ;
|
||||
len -= 8 ;
|
||||
@@ -1251,7 +1251,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
|
||||
if (len < 4)
|
||||
goto len_error ;
|
||||
if (set)
|
||||
memcpy((char *) to,(char *) from,4) ;
|
||||
memcpy(to,from,4) ;
|
||||
to += 4 ;
|
||||
from += 4 ;
|
||||
len -= 4 ;
|
||||
@@ -1260,7 +1260,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
|
||||
if (len < 8)
|
||||
goto len_error ;
|
||||
if (set)
|
||||
memcpy((char *) to,(char *) from,8) ;
|
||||
memcpy(to,from,8) ;
|
||||
to += 8 ;
|
||||
from += 8 ;
|
||||
len -= 8 ;
|
||||
@@ -1269,7 +1269,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
|
||||
if (len < 32)
|
||||
goto len_error ;
|
||||
if (set)
|
||||
memcpy((char *) to,(char *) from,32) ;
|
||||
memcpy(to,from,32) ;
|
||||
to += 32 ;
|
||||
from += 32 ;
|
||||
len -= 32 ;
|
||||
|
Reference in New Issue
Block a user