linux/drivers/target/iscsi/cxgbit
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
..
Kconfig libcxgb: add library module for Chelsio drivers 2016-07-25 10:31:08 -07:00
Makefile libcxgb: add library module for Chelsio drivers 2016-07-25 10:31:08 -07:00
cxgbit.h libcxgb: add library module for Chelsio drivers 2016-07-25 10:31:08 -07:00
cxgbit_cm.c net: introduce __skb_put_[zero, data, u8] 2017-06-20 13:30:14 -04:00
cxgbit_ddp.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
cxgbit_lro.h target/cxgbit: add T6 iSCSI DDP completion feature 2017-02-18 21:24:21 -08:00
cxgbit_main.c target/cxgbit: add T6 iSCSI DDP completion feature 2017-02-18 21:24:21 -08:00
cxgbit_target.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00