1. 16 9月, 2017 1 次提交
  2. 26 8月, 2017 1 次提交
  3. 16 6月, 2017 3 次提交
    • J
      networking: make skb_push & __skb_push return void pointers · d58ff351
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions return void * and remove all the casts across
      the tree, adding a (u8 *) cast only where the unsigned char pointer
      was used directly, all done with the following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
          @@
          expression SKB, LEN;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          @@
          - fn(SKB, LEN)[0]
          + *(u8 *)fn(SKB, LEN)
      
      Note that the last part there converts from push(...)[0] to the
      more idiomatic *(u8 *)push(...).
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d58ff351
    • J
      networking: make skb_put & friends return void pointers · 4df864c1
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions (skb_put, __skb_put and pskb_put) return void *
      and remove all the casts across the tree, adding a (u8 *) cast only
      where the unsigned char pointer was used directly, all done with the
      following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_put, __skb_put };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_put, __skb_put };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
      which actually doesn't cover pskb_put since there are only three
      users overall.
      
      A handful of stragglers were converted manually, notably a macro in
      drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
      instances in net/bluetooth/hci_sock.c. In the former file, I also
      had to fix one whitespace problem spatch introduced.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4df864c1
    • J
      networking: convert many more places to skb_put_zero() · b080db58
      Johannes Berg 提交于
      There were many places that my previous spatch didn't find,
      as pointed out by yuan linyu in various patches.
      
      The following spatch found many more and also removes the
      now unnecessary casts:
      
          @@
          identifier p, p2;
          expression len;
          expression skb;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_zero(skb, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_zero(skb, len);
          )
          ... when != p
          (
          p2 = (t2)p;
          -memset(p2, 0, len);
          |
          -memset(p, 0, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_zero(skb, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_zero(skb, sizeof(t));
          )
          ... when != p
          (
          p2 = (t2)p;
          -memset(p2, 0, sizeof(*p));
          |
          -memset(p, 0, sizeof(*p));
          )
      
          @@
          expression skb, len;
          @@
          -memset(skb_put(skb, len), 0, len);
          +skb_put_zero(skb, len);
      
      Apply it to the tree (with one manual fixup to keep the
      comment in vxlan.c, which spatch removed.)
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b080db58
  4. 13 6月, 2017 2 次提交
  5. 26 4月, 2017 1 次提交
  6. 28 2月, 2017 1 次提交
  7. 07 2月, 2017 2 次提交
  8. 09 11月, 2016 17 次提交
  9. 27 9月, 2016 1 次提交
  10. 24 8月, 2016 1 次提交
    • J
      scsi: fcoe: provide translation table between Ethernet and FC port speeds · 0b924e55
      Johannes Thumshirn 提交于
      Provide a translation table between Ethernet and FC port speeds so odd
      speeds (from a Ethernet POV) like 8 Gbit are correctly mapped to sysfs
      and open-fcoe's fcoeadm.
      
      Before:
          Description:      BCM57840 NetXtreme II 10/20-Gigabit Ethernet
          Revision:         11
          Manufacturer:     Broadcom Corporation
          Serial Number:    6CC2173EA1D0
      
          Driver:           bnx2x 1.712.30-0
          Number of Ports:  1
      
              Symbolic Name:     bnx2fc (QLogic BCM57840) v2.10.3 over eth2
              OS Device Name:    host1
              Node Name:         0x20006cc2173ea1d1
              Port Name:         0x10006cc2173ea1d1
              FabricName:        0x100000c0dd0ce717
              Speed:             unknown
              Supported Speed:   1 Gbit, 10 Gbit
              MaxFrameSize:      2048 bytes
              FC-ID (Port ID):   0x660702
              State:             Online
      
      After:
          Description:      BCM57840 NetXtreme II 10/20-Gigabit Ethernet
          Revision:         11
          Manufacturer:     Broadcom Corporation
          Serial Number:    6CC2173EA1D0
      
          Driver:           bnx2x 1.712.30-0
          Number of Ports:  1
      
              Symbolic Name:     bnx2fc (QLogic BCM57840) v2.10.3 over eth2
              OS Device Name:    host1
              Node Name:         0x20006cc2173ea1d1
              Port Name:         0x10006cc2173ea1d1
              FabricName:        0x100000c0dd0ce717
              Speed:             8 Gbit
              Supported Speed:   1 Gbit, 10 Gbit
              MaxFrameSize:      2048 bytes
              FC-ID (Port ID):   0x660701
              State:             Online
      Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: NHannes Reinicke <hare@suse.de>
      Reviewed-by: NLee Duncan <lduncan@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0b924e55
  11. 05 8月, 2016 1 次提交
  12. 02 8月, 2016 1 次提交
  13. 27 7月, 2016 1 次提交
  14. 21 7月, 2016 2 次提交
  15. 14 7月, 2016 5 次提交