]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ethernet: Remove casts to same type
authorJoe Perches <joe@perches.com>
Mon, 4 Jun 2012 12:44:16 +0000 (12:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jun 2012 16:31:33 +0000 (09:31 -0700)
commit6469933605a3ecdfa66b98160cde98ecd256cb3f
tree9d80273c26cbec4b3064eee47ba173be11ac444f
parent20d5ec435c5fba8142eb7df692a5f54fbb26e892
ethernet: 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

A function in atl1e_main.c was passed a const pointer
when it actually modified elements of the structure.

Change the argument to a non-const pointer.

A function in stmmac needed a __force to avoid a sparse
warning.  Added it.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
34 files changed:
drivers/net/ethernet/8390/apne.c
drivers/net/ethernet/aeroflex/greth.c
drivers/net/ethernet/amd/declance.c
drivers/net/ethernet/apple/macmace.c
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
drivers/net/ethernet/atheros/atlx/atl1.c
drivers/net/ethernet/broadcom/bnx2.c
drivers/net/ethernet/broadcom/cnic.c
drivers/net/ethernet/brocade/bna/cna_fwimg.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
drivers/net/ethernet/chelsio/cxgb4/sge.c
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
drivers/net/ethernet/chelsio/cxgb4vf/sge.c
drivers/net/ethernet/dec/tulip/de4x5.c
drivers/net/ethernet/freescale/ucc_geth.c
drivers/net/ethernet/hp/hp100.c
drivers/net/ethernet/i825xx/lp486e.c
drivers/net/ethernet/i825xx/sun3_82586.c
drivers/net/ethernet/marvell/mv643xx_eth.c
drivers/net/ethernet/marvell/pxa168_eth.c
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
drivers/net/ethernet/neterion/s2io.c
drivers/net/ethernet/neterion/vxge/vxge-config.c
drivers/net/ethernet/neterion/vxge/vxge-config.h
drivers/net/ethernet/neterion/vxge/vxge-main.c
drivers/net/ethernet/neterion/vxge/vxge-traffic.c
drivers/net/ethernet/sgi/ioc3-eth.c
drivers/net/ethernet/smsc/smsc9420.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/sun/sunqe.c
drivers/net/ethernet/via/via-velocity.c