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
@@ -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