1. 23 Jan, 2017 5 commits
    • Bhumika Goyal's avatar
      net: xilinx: constify net_device_ops structure · 10eeb5e6
      Bhumika Goyal authored
      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: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      10eeb5e6
    • Bhumika Goyal's avatar
      net: moxa: constify net_device_ops structures · 30bd2f52
      Bhumika Goyal authored
      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
         4821	    744	      0	   5565	   15bd ethernet/moxa/moxart_ether.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         5373	    192	      0	   5565	   15bd ethernet/moxa/moxart_ether.o
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30bd2f52
    • Timur Tabi's avatar
      net: qcom/emac: claim the irq only when the device is opened · 4404323c
      Timur Tabi authored
      During reset, functions emac_mac_down() and emac_mac_up() are called,
      so we don't want to free and claim the IRQ unnecessarily.  Move those
      operations to open/close.
      Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
      Reviewed-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4404323c
    • Timur Tabi's avatar
      net: qcom/emac: rename emac_phy to emac_sgmii and move it · 41c1093f
      Timur Tabi authored
      The EMAC has an internal PHY that is often called the "SGMII".  This
      SGMII is also connected to an external PHY, which is managed by phylib.
      These dual PHYs often cause confusion.  In this case, the data structure
      for managing the SGMII was mis-named and located in the wrong header file.
      
      Structure emac_phy is renamed to emac_sgmii to clearly indicate it applies
      to the internal PHY only.  It also also moved from emac_phy.h (which
      supports the external PHY) to emac_sgmii.h (where it belongs).
      
      To keep the changes minimal, only the structure name is changed, not
      the names of any variables of that type.
      Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41c1093f
    • Eric Dumazet's avatar
      bnx2x: avoid two atomic ops per page on x86 · b9032741
      Eric Dumazet authored
      Commit 4cace675 ("bnx2x: Alloc 4k fragment for each rx ring buffer
      element") added extra put_page() and get_page() calls on arches where
      PAGE_SIZE=4K like x86
      
      Reorder things to avoid this overhead.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9032741
  2. 22 Jan, 2017 15 commits
  3. 20 Jan, 2017 20 commits