linux/drivers/net/ethernet/chelsio/cxgb3
yuan linyu de77b966ce net: introduce __skb_put_[zero, data, u8]
follow Johannes Berg, semantic patch file as below,
@@
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);
)

@@
identifier p;
expression len;
expression skb;
type t;
@@
(
-t p = __skb_put(skb, len);
+t p = __skb_put_zero(skb, len);
)
... when != p
(
-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);

@@
expression skb, len, data;
@@
-memcpy(__skb_put(skb, len), data, len);
+__skb_put_data(skb, data, len);

@@
expression SKB, C, S;
typedef u8;
identifier fn = {__skb_put};
fresh identifier fn2 = fn ## "_u8";
@@
- *(u8 *)fn(SKB, S) = C;
+ fn2(SKB, C);

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-20 13:30:14 -04:00
..
Makefile
adapter.h net: cxgb3: Use net_device_stats from struct net_device 2017-04-07 07:03:33 -07:00
ael1002.c chelsio: constify cphy_ops structures 2016-01-04 21:58:28 -05:00
aq100x.c chelsio: constify cphy_ops structures 2016-01-04 21:58:28 -05:00
common.h chelsio: constify cphy_ops structures 2016-01-04 21:58:28 -05:00
cxgb3_ctl_defs.h
cxgb3_defs.h treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
cxgb3_ioctl.h
cxgb3_main.c net: introduce __skb_put_[zero, data, u8] 2017-06-20 13:30:14 -04:00
cxgb3_offload.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
cxgb3_offload.h
firmware_exports.h
l2t.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
l2t.h treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
mc5.c net: ethernet: chelsio: cxgb3: mc5.c: Remove some unused functions 2015-01-02 16:32:37 -05:00
regs.h chelsio: remove duplicate defines 2013-10-21 18:46:45 -04:00
sge.c net: introduce __skb_put_[zero, data, u8] 2017-06-20 13:30:14 -04:00
sge_defs.h
t3_cpl.h
t3_hw.c cxgb3: fix up vpd strings for kstrto*() 2016-02-19 15:49:31 -05:00
t3cdev.h
version.h
vsc8211.c chelsio: constify cphy_ops structures 2016-01-04 21:58:28 -05:00
xgmac.c