linux_dsm_epyc7002/drivers/net/ethernet/xilinx
Bhumika Goyal 10eeb5e645 net: xilinx: constify net_device_ops structure
Declare net_device_ops structure as const as it is only stored in
the netdev_ops field of a net_device structure. This field is of type
const, so net_device_ops structures having same properties can be made
const too.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct net_device_ops i@p={...};

@ok1@
identifier r1.i;
position p;
struct net_device ndev;
@@
ndev.netdev_ops=&i@p

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct net_device_ops i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   6201	    744	      0	   6945	   1b21 ethernet/xilinx/xilinx_emaclite.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   6745	    192	      0	   6937	   1b19 ethernet/xilinx/xilinx_emaclite.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-23 15:58:49 -05:00
..
Kconfig net: ethernet: xilinx: Enable emaclite for MIPS 2016-09-08 16:06:37 -07:00
ll_temac_main.c net: ll_temac: Utilize of_get_mac_address() 2016-12-08 11:34:03 -05:00
ll_temac_mdio.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
ll_temac.h net: ethernet: ll_temac: use phydev from struct net_device 2016-07-14 17:42:30 -07:00
Makefile
xilinx_axienet_main.c net: axienet: Utilize of_get_mac_address() 2016-12-08 11:34:03 -05:00
xilinx_axienet_mdio.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
xilinx_axienet.h net: ethernet: xilinx: axienet: use phydev from struct net_device 2016-07-15 16:41:34 -07:00
xilinx_emaclite.c net: xilinx: constify net_device_ops structure 2017-01-23 15:58:49 -05:00