Catégorie : Linux

Btrfs: using for_each_set_bit_from to simplify the code

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Using for_each_set_bit_from() to simplify the code. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun — fs/btrfs/free-space-cache.c | 8 ++—— 1 file changed, 2 insertions(+), 6 deletions(-)   diff –git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 6b10acf..b107e68 100644 — a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1454,9 +1454,7 @@ static int search_bitmap(struct …

Lire la suite

gpio_msm: using for_each_set_bit to simplify the code

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Using for_each_set_bit() to simplify the code. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Acked-by: David Brown Signed-off-by: Linus Walleij — drivers/gpio/gpio-msm-v2.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c index 5cb1227..38305be 100644 — a/drivers/gpio/gpio-msm-v2.c +++ b/drivers/gpio/gpio-msm-v2.c @@ …

Lire la suite

ARM: S3C24XX: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Kukjin Kim — arch/arm/mach-s3c24xx/mach-h1940.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index 477778c..7e15cc4 100644 — a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -460,7 +460,7 @@ static void h1940_set_mmc_power(unsigned char power_mode, unsigned short vdd) …

Lire la suite

ARM: S3C24xx: delete double assignment

Author: Julia Lawall <Julia.Lawall@lip6.fr> Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression i; @@ *i = …; i = …; // Signed-off-by: Julia Lawall Signed-off-by: Kukjin Kim — arch/arm/mach-s3c24xx/mach-h1940.c | 2 +- 1 file changed, 1 insertion(+), 1 …

Lire la suite

drivers/usb/host/sl811-hcd.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Greg Kroah-Hartman — drivers/usb/host/sl811-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 91ce1c0..619b05f 100644 — a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -156,7 +156,7 @@ static void setup_packet( writeb(SL_SETUP /* | ep->epnum */, …

Lire la suite

drivers/usb/misc/rio500.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Greg Kroah-Hartman — drivers/usb/misc/rio500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 1084124..b9b356a 100644 — a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -338,7 +338,7 @@ write_rio(struct file *file, const char __user *buffer, thistime …

Lire la suite

drivers/char: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Greg Kroah-Hartman — drivers/char/nwbutton.c | 4 ++– drivers/char/rtc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)   diff –git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c index 04a480f..cfdfe49 100644 — a/drivers/char/nwbutton.c +++ b/drivers/char/nwbutton.c @@ -93,9 +93,9 @@ int button_del_callback (void (*callback) …

Lire la suite

drivers/usb/host/xhci-ring.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Sarah Sharp — drivers/usb/host/xhci-ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 37e23ed..f270e70 100644 — a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2852,7 +2852,7 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, …

Lire la suite

ASoC: core: Remove useless kfree

Author: Peter Senna Tschudin <peter.senna@gmail.com> Remove useless kfree() and clean up code related to the removal. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ position p1,p2; expression x; @@ if (x@p1 == NULL) { … kfree@p2(x); … return …; } @unchanged exists@ position r.p1,r.p2; expression e

drivers/char/mmtimer.c: Remove useless kfree

Author: Peter Senna Tschudin <peter.senna@gmail.com> Remove useless kfree() and clean up code related to the removal. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ position p1,p2; expression x; @@ if (x@p1 == NULL) { … kfree@p2(x); … return …; } @unchanged exists@ position r.p1,r.p2; expression e