irttp: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller — net/irda/irttp.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/net/irda/irttp.c b/net/irda/irttp.c index 32e3bb0..5c93f29 100644 — a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -1461,14 +1461,12 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, …

Continue reading

ks8*/ksz8*: Casting (void *) value returned by kmalloc is useless

Author: Thomas Meyer <thomas@m3y3r.de> The semantic patch that makes this change is available in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller — drivers/net/ethernet/micrel/ks8851_mll.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index d19c849..228c5c0 100644 — a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c @@ -1500,8 +1500,7 @@ static int ks_hw_init(struct ks_net *ks) …

Continue reading

ksz884x: Use kzalloc rather than kmalloc followed by memset with 0

Author: Thomas Meyer <thomas@m3y3r.de> This considers some simple cases that are common and easy to validate Note in particular that there are no …s in the rule, so all of the matched code has to be contiguous The semantic patch that makes this change is available in scripts/coccinelle/api/alloc/kzalloc-simple.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller …

Continue reading

RxRPC: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller — net/rxrpc/ar-key.c | 6 ++—- 1 file changed, 2 insertions(+), 4 deletions(-)   diff –git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 43ea7de..4cba13e 100644 — a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c @@ -306,10 +306,9 @@ static int rxrpc_krb5_decode_tagged_data(struct krb5_tagged_data *td, …

Continue reading

CDC NCM: Use kzalloc rather than kmalloc followed by memset with 0

Author: Thomas Meyer <thomas@m3y3r.de> This considers some simple cases that are common and easy to validate Note in particular that there are no …s in the rule, so all of the matched code has to be contiguous The semantic patch that makes this change is available in scripts/coccinelle/api/alloc/kzalloc-simple.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller …

Continue reading

sparc: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: David S. Miller — arch/sparc/kernel/ds.c | 6 ++—- arch/sparc/kernel/prom_common.c | 4 +— 2 files changed, 3 insertions(+), 7 deletions(-)   diff –git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 7429b47..381edcd 100644 — a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -1181,13 +1181,11 @@ static …

Continue reading

staging: hv: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: Greg Kroah-Hartman — drivers/staging/hv/hv_mouse.c | 4 +— drivers/staging/hv/netvsc.c | 11 +++——– 2 files changed, 4 insertions(+), 11 deletions(-)   diff –git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c index 2c2e1b4..a28c549 100644 — a/drivers/staging/hv/hv_mouse.c +++ …

Continue reading

Staging: speakup: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: Greg Kroah-Hartman — drivers/staging/speakup/kobjects.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 07a7f54..2093896 100644 — a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -265,12 +265,11 …

Continue reading

usb: OHCI/EHCI-XLS: Use resource_size v3

Author: Thomas Meyer <thomas@m3y3r.de> Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci. Signed-off-by: Thomas Meyer Signed-off-by: Greg Kroah-Hartman — drivers/usb/host/ehci-xls.c | 2 +- drivers/usb/host/ohci-xls.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/usb/host/ehci-xls.c b/drivers/usb/host/ehci-xls.c index fe74bd6..1078d67 100644 …

Continue reading

ceph: Use kmemdup rather than duplicating its implementation

Author: Thomas Meyer <thomas@m3y3r.de> Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer Signed-off-by: Sage Weil — net/ceph/crypto.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/net/ceph/crypto.c b/net/ceph/crypto.c index 85f3bc0..b780cb7 100644 — a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -15,10 +15,9 …

Continue reading