[PATCH 2/2] leds: lm3533: constify attribute_group structure

2017-08-10 Thread Amitoj Kaur Chawla
-lm3533.o File size after: text data bss dec hex filename 8368 4512 64 129443290 drivers/leds/leds-lm3533.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/leds/leds-lm3533.c | 2 +-

[PATCH 1/2] leds: blinkm: constify attribute_group structure

2017-08-10 Thread Amitoj Kaur Chawla
-blinkm.o File size after: text data bss dec hex filename 8753 3400 64 122172fb9 drivers/leds/leds-blinkm.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/leds/leds-blinkm.c | 2 +-

[PATCH 1/2] leds: blinkm: constify attribute_group structure

2017-08-10 Thread Amitoj Kaur Chawla
-blinkm.o File size after: text data bss dec hex filename 8753 3400 64 122172fb9 drivers/leds/leds-blinkm.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/leds/leds-blinkm.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] leds: lm3533: constify attribute_group structure

2017-08-10 Thread Amitoj Kaur Chawla
-lm3533.o File size after: text data bss dec hex filename 8368 4512 64 129443290 drivers/leds/leds-lm3533.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/leds/leds-lm3533.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] imon: constify attribute_group structures

2017-08-04 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 3717316584 960 54717d5bd drivers/media/rc/imon.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/media/rc/imon.c | 4 ++-- 1 file chan

[PATCH] imon: constify attribute_group structures

2017-08-04 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 3717316584 960 54717d5bd drivers/media/rc/imon.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/media/rc/imon.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] thunderbolt: constify attribute_group structure

2017-08-04 Thread Amitoj Kaur Chawla
/switch.o File size after: text data bss dec hex filename 28661 7204 0 358658c19 drivers/thunderbolt/switch.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/thunderbolt/switch.c | 2 +-

[PATCH] thunderbolt: constify attribute_group structure

2017-08-04 Thread Amitoj Kaur Chawla
/switch.o File size after: text data bss dec hex filename 28661 7204 0 358658c19 drivers/thunderbolt/switch.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/thunderbolt/switch.c | 2 +- 1 file changed, 1 insertion

[PATCH] loop: constify attribute_group structure

2017-08-02 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 28320 5421 480 3422185ad drivers/block/loop.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/block/loop.c | 2 +- 1 file changed, 1 ins

[PATCH] loop: constify attribute_group structure

2017-08-02 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 28320 5421 480 3422185ad drivers/block/loop.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] ACPI / dock: constify attribute_group structure

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 7998 3432 64 114942ce6 drivers/acpi/dock.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/acpi/dock.c | 2 +- 1 file changed, 1 insertion

[PATCH] ACPI / dock: constify attribute_group structure

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 7998 3432 64 114942ce6 drivers/acpi/dock.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/acpi/dock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 2/2] atm: solos-pci: constify attribute_group structures

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 3593228232 832 64996fde4 drivers/atm/solos-pci.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/atm/solos-pci.c | 4 ++-- 1 file chan

[PATCH 2/2] atm: solos-pci: constify attribute_group structures

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 3593228232 832 64996fde4 drivers/atm/solos-pci.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/atm/solos-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 1/2] atm: adummy: constify attribute_group structure

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 2129 1352 03481 d99 drivers/atm/adummy.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/atm/adummy.c | 2 +- 1 file changed, 1 ins

[PATCH 1/2] atm: adummy: constify attribute_group structure

2017-08-01 Thread Amitoj Kaur Chawla
File size after: text data bss dec hex filename 2129 1352 03481 d99 drivers/atm/adummy.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/atm/adummy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] staging: greybus: Remove unnecessary platform_set_drvdata

2017-07-26 Thread Amitoj Kaur Chawla
platform_device *pdev; @@ - platform_set_drvdata(pdev, NULL); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/staging/greybus/arche-platform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus

[PATCH] staging: greybus: Remove unnecessary platform_set_drvdata

2017-07-26 Thread Amitoj Kaur Chawla
platform_device *pdev; @@ - platform_set_drvdata(pdev, NULL); // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/greybus/arche-platform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index eced2d2

[PATCH] staging: unisys: visorchipset: constify attribute_group structure

2017-07-26 Thread Amitoj Kaur Chawla
/visorbus/visorchipset.o File size after: text data bss dec hex filename 242206120 448 307887844 drivers/staging/unisys/visorbus/visorchipset.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- d

[PATCH] staging: unisys: visorchipset: constify attribute_group structure

2017-07-26 Thread Amitoj Kaur Chawla
/visorbus/visorchipset.o File size after: text data bss dec hex filename 242206120 448 307887844 drivers/staging/unisys/visorbus/visorchipset.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/unisys/visorbus

[PATCH] staging: unisys: visorbus_main: constify attribute_group structures

2017-07-25 Thread Amitoj Kaur Chawla
/visorbus/visorbus_main.o File size after: text data bss dec hex filename 144087112 832 223525750 drivers/staging/unisys/visorbus/visorbus_main.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- d

[PATCH] staging: unisys: visorbus_main: constify attribute_group structures

2017-07-25 Thread Amitoj Kaur Chawla
/visorbus/visorbus_main.o File size after: text data bss dec hex filename 144087112 832 223525750 drivers/staging/unisys/visorbus/visorbus_main.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/unisys/visorbus

[PATCH v2] staging: media: atomisp: Use kvfree() instead of kfree()/vfree()

2017-07-10 Thread Amitoj Kaur Chawla
: // @@ expression a; @@ - if(...) { vfree(a); } - else { kfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Remove wrapper function .../staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 19 +++ .../staging/media/a

[PATCH v2] staging: media: atomisp: Use kvfree() instead of kfree()/vfree()

2017-07-10 Thread Amitoj Kaur Chawla
: // @@ expression a; @@ - if(...) { vfree(a); } - else { kfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Remove wrapper function .../staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 19 +++ .../staging/media/atomisp/pci/atomisp2

Re: [PATCH 2/2] staging: media: atomisp2: Replace kfree()/vfree() with kvfree()

2017-07-08 Thread Amitoj Kaur Chawla
On Sat, Jul 8, 2017 at 4:58 AM, Bernd Petrovitsch <be...@petrovitsch.priv.at> wrote: > On Fri, 2017-07-07 at 20:41 -0400, Amitoj Kaur Chawla wrote: > [...] >> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c >> +++ b/drivers/staging/media/atomisp/pc

Re: [PATCH 2/2] staging: media: atomisp2: Replace kfree()/vfree() with kvfree()

2017-07-08 Thread Amitoj Kaur Chawla
On Sat, Jul 8, 2017 at 4:58 AM, Bernd Petrovitsch wrote: > On Fri, 2017-07-07 at 20:41 -0400, Amitoj Kaur Chawla wrote: > [...] >> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c >> +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c >> @

[PATCH 2/2] staging: media: atomisp2: Replace kfree()/vfree() with kvfree()

2017-07-07 Thread Amitoj Kaur Chawla
(a); } - else { kfree(a); } + kvfree(a); @@ expression a; @@ - if(...) { kfree(a); } - else { vfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 6 +- 1 file changed, 1 insertion(+), 5 del

[PATCH 2/2] staging: media: atomisp2: Replace kfree()/vfree() with kvfree()

2017-07-07 Thread Amitoj Kaur Chawla
(a); } - else { kfree(a); } + kvfree(a); @@ expression a; @@ - if(...) { kfree(a); } - else { vfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers

[PATCH 1/2] staging: media: atomisp2: css2400: Replace kfree()/vfree() with kvfree()

2017-07-07 Thread Amitoj Kaur Chawla
(a); @@ expression a; @@ - if(...) { kfree(a); } - else { vfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/media/atomi

[PATCH 1/2] staging: media: atomisp2: css2400: Replace kfree()/vfree() with kvfree()

2017-07-07 Thread Amitoj Kaur Chawla
(a); @@ expression a; @@ - if(...) { kfree(a); } - else { vfree(a); } + kvfree(a); // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400

[PATCH] staging: comedi: Use offset_in_page macro

2017-07-03 Thread Amitoj Kaur Chawla
Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // @@ unsigned long p; @@ - p & ~PAGE_MASK + offset_in_page(p) // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/staging/comedi/co

[PATCH] staging: comedi: Use offset_in_page macro

2017-07-03 Thread Amitoj Kaur Chawla
Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // @@ unsigned long p; @@ - p & ~PAGE_MASK + offset_in_page(p) // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/comedi/comedi_buf.c | 2 +- 1 file ch

[PATCH] staging: media: atomisp: Remove unnecessary return statement in void function

2017-06-29 Thread Amitoj Kaur Chawla
Return statement at the end of a void function is useless. The Coccinelle semantic patch used to make this change is as follows: // @@ identifier f; expression e; @@ void f(...) { <... - return e; ...> } // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/s

[PATCH] staging: media: atomisp: Remove unnecessary return statement in void function

2017-06-29 Thread Amitoj Kaur Chawla
Return statement at the end of a void function is useless. The Coccinelle semantic patch used to make this change is as follows: // @@ identifier f; expression e; @@ void f(...) { <... - return e; ...> } // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/media/atomisp/pci/at

[PATCH] staging: rtl8723bs: Remove unnecessary cast in kfree

2017-06-14 Thread Amitoj Kaur Chawla
Remove unnecassary casts in the argument to kfree. Found using Coccinelle. The semantic patch used to find this is as follows: // @@ type T; expression *f; @@ - kfree((T *)(f)); + kfree(f); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/staging/rtl8723bs/

[PATCH] staging: rtl8723bs: Remove unnecessary cast in kfree

2017-06-14 Thread Amitoj Kaur Chawla
Remove unnecassary casts in the argument to kfree. Found using Coccinelle. The semantic patch used to find this is as follows: // @@ type T; expression *f; @@ - kfree((T *)(f)); + kfree(f); // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 14

Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-19 Thread Amitoj Kaur Chawla
On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring wrote: >> +@vz1 depends on patch && !context && !org && !report@ >> +type T; >> +T *d; >> +statement S; >> +@@ >> + >> +d = >> +-vmalloc >> ++vzalloc >> + (...); >> +

Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-19 Thread Amitoj Kaur Chawla
On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring wrote: >> +@vz1 depends on patch && !context && !org && !report@ >> +type T; >> +T *d; >> +statement S; >> +@@ >> + >> +d = >> +-vmalloc >> ++vzalloc >> + (...); >> +if (!d) S >> +-

[PATCH v2] drm/tegra: dpaux: Modify error handling

2016-08-14 Thread Amitoj Kaur Chawla
urn - ... + PTR_ERR(e) ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Correct typo drivers/gpu/drm/tegra/dpaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/t

[PATCH v2] drm/tegra: dpaux: Modify error handling

2016-08-14 Thread Amitoj Kaur Chawla
urn - ... + PTR_ERR(e) ; ...+> } Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Correct typo drivers/gpu/drm/tegra/dpaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 059f409..2

[PATCH] drm/nouveau/tegra: Modify error handling

2016-08-14 Thread Amitoj Kaur Chawla
iommu_domain_alloc returns NULL on error so replace an incorrect IS_ERR check with a NULL check. The Coccinelle semantic patch used to find this issue is as follows: @@ expression e; statement S; @@ *e = iommu_domain_alloc(...); if (IS_ERR(e)) S Signed-off-by: Amitoj Kaur Chawla <amit

[PATCH] drm/nouveau/tegra: Modify error handling

2016-08-14 Thread Amitoj Kaur Chawla
iommu_domain_alloc returns NULL on error so replace an incorrect IS_ERR check with a NULL check. The Coccinelle semantic patch used to find this issue is as follows: @@ expression e; statement S; @@ *e = iommu_domain_alloc(...); if (IS_ERR(e)) S Signed-off-by: Amitoj Kaur Chawla --- drivers

[PATCH] drm/tegra: dpaux: Modify error handling

2016-08-12 Thread Amitoj Kaur Chawla
urn - ... + PTR_ERR(e) ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/gpu/drm/tegra/dpaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 059f409..2f

[PATCH] drm/tegra: dpaux: Modify error handling

2016-08-12 Thread Amitoj Kaur Chawla
urn - ... + PTR_ERR(e) ; ...+> } Signed-off-by: Amitoj Kaur Chawla --- drivers/gpu/drm/tegra/dpaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 059f409..2fde44c 100644 --- a/drivers/gpu/drm

[PATCH] MIPS: ath79: Modify error handling

2016-08-11 Thread Amitoj Kaur Chawla
Kaur Chawla <amitoj1...@gmail.com> --- arch/mips/ath79/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index 2e73784..cc3a1e3 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -96,7 +96,7 @@

[PATCH] MIPS: ath79: Modify error handling

2016-08-11 Thread Amitoj Kaur Chawla
Kaur Chawla --- arch/mips/ath79/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index 2e73784..cc3a1e3 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -96,7 +96,7 @@ static struct clk * __init

[PATCH] sunrpc: Remove unnecessary variable

2016-08-08 Thread Amitoj Kaur Chawla
The variable `err` is not used anywhere and just returns the predefined value `0` at the end of the function. Hence, remove the variable and return 0 explicitly. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- net/sunrpc/clnt.c | 3 +-- 1 file changed, 1 insertion(+), 2 del

[PATCH] sunrpc: Remove unnecessary variable

2016-08-08 Thread Amitoj Kaur Chawla
The variable `err` is not used anywhere and just returns the predefined value `0` at the end of the function. Hence, remove the variable and return 0 explicitly. Signed-off-by: Amitoj Kaur Chawla --- net/sunrpc/clnt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net

[PATCH v3] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-08-06 Thread Amitoj Kaur Chawla
This script detects cases which have incorrect error handling for devm_ioremap_resource function, employing a NULL test instead of an IS_ERR() test. Acked-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Ch

[PATCH v3] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-08-06 Thread Amitoj Kaur Chawla
This script detects cases which have incorrect error handling for devm_ioremap_resource function, employing a NULL test instead of an IS_ERR() test. Acked-by: Julia Lawall Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Changed script to correct error handling instead of just

[PATCH] drm/amdgpu: Modify error handling in amdgpu_ttm

2016-08-04 Thread Amitoj Kaur Chawla
; @@ * e = debugfs_create_file(...); ... when != e == NULL e->f Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/a

[PATCH] drm/amdgpu: Modify error handling in amdgpu_ttm

2016-08-04 Thread Amitoj Kaur Chawla
; @@ * e = debugfs_create_file(...); ... when != e == NULL e->f Signed-off-by: Amitoj Kaur Chawla --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 8a17

[PATCH] drm/amdgpu: Modify error handling

2016-08-04 Thread Amitoj Kaur Chawla
; @@ * e = debugfs_create_file(...); ... when != e == NULL e->f Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a

[PATCH] drm/amdgpu: Modify error handling

2016-08-04 Thread Amitoj Kaur Chawla
; @@ * e = debugfs_create_file(...); ... when != e == NULL e->f Signed-off-by: Amitoj Kaur Chawla --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c in

[PATCH] iommu/exynos: Modify error handling

2016-08-01 Thread Amitoj Kaur Chawla
) { <+... return - PTR_ERR(e) + -ENODEV ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/iommu/exynos-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 97c41b8..28

[PATCH] iommu/exynos: Modify error handling

2016-08-01 Thread Amitoj Kaur Chawla
) { <+... return - PTR_ERR(e) + -ENODEV ; ...+> } Signed-off-by: Amitoj Kaur Chawla --- drivers/iommu/exynos-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 97c41b8..2888bbf 100644 --- a/drivers/iommu/

[PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-01 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> Acked-by: Julia Lawall <julia.law...@lip6.fr> --- Changes in v2: -Modified commit message

[PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-01 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla Acked-by: Julia Lawall --- Changes in v2: -Modified commit message and subject Changes in v3: -Modified comment

[PATCH] i2c: Modify error handling

2016-07-30 Thread Amitoj Kaur Chawla
...; + return PTR_ERR(e); } Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/media/i2c/adp1653.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c index 7e9cbf7..54b355e 100644 --- a/drivers/med

[PATCH] i2c: Modify error handling

2016-07-30 Thread Amitoj Kaur Chawla
...; + return PTR_ERR(e); } Signed-off-by: Amitoj Kaur Chawla --- drivers/media/i2c/adp1653.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c index 7e9cbf7..54b355e 100644 --- a/drivers/media/i2c/adp1653.c +++ b/drivers

[PATCH] s390/pci: Remove unnecessary if condition

2016-07-29 Thread Amitoj Kaur Chawla
-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- arch/s390/pci/pci_debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c index 4129b0a..8a25b04 100644 --- a/arch/s390/pci/pci_debug.c +++ b/arch/s390/pci/pci_debug.c @@ -139,8 +139,6 @

[PATCH] s390/pci: Remove unnecessary if condition

2016-07-29 Thread Amitoj Kaur Chawla
-by: Amitoj Kaur Chawla --- arch/s390/pci/pci_debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c index 4129b0a..8a25b04 100644 --- a/arch/s390/pci/pci_debug.c +++ b/arch/s390/pci/pci_debug.c @@ -139,8 +139,6 @@ void zpci_debug_init_device

[PATCH] MIPS: Modify error handling

2016-07-29 Thread Amitoj Kaur Chawla
ERR(e) + -ENOMEM ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- arch/mips/mm/sc-debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/sc-debugfs.c b/arch/mips/mm/sc-debugfs.c index 5eefe32..01f1154 100644 --- a/arc

[PATCH] MIPS: Modify error handling

2016-07-29 Thread Amitoj Kaur Chawla
ERR(e) + -ENOMEM ; ...+> } Signed-off-by: Amitoj Kaur Chawla --- arch/mips/mm/sc-debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/sc-debugfs.c b/arch/mips/mm/sc-debugfs.c index 5eefe32..01f1154 100644 --- a/arch/mips/mm/sc-debugfs.c +++ b/arc

[PATCH v2] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-07-28 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Modified commit message and subject scripts/coccinelle/api/zalloc.cocci

[PATCH v2] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-07-28 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Modified commit message and subject scripts/coccinelle/api/zalloc.cocci | 556

[PATCH v2] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-07-25 Thread Amitoj Kaur Chawla
This script detects cases which have incorrect error handling for devm_ioremap_resource function, employing a NULL test instead of an IS_ERR() test. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Changed script to correct error handling instead o

[PATCH v2] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-07-25 Thread Amitoj Kaur Chawla
This script detects cases which have incorrect error handling for devm_ioremap_resource function, employing a NULL test instead of an IS_ERR() test. Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Changed script to correct error handling instead of just detecting cases

[PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions

2016-07-23 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memcpy which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- scripts/coccinelle/api/zalloc.cocci | 556 1 file change

[PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions

2016-07-23 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memcpy which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla --- scripts/coccinelle/api/zalloc.cocci | 556 1 file changed, 556 insertions(+) create mode

[PATCH] clocksource/drivers/timer-sp804: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- d

[PATCH] clocksource/drivers/timer-sp804: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla --- drivers/clocksource/timer-sp804.c

[PATCH] drm: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drive

[PATCH] drm: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla --- drivers/gpu/drm/fsl-dcu

[PATCH] ARM: sa1111: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- ar

[PATCH] ARM: sa1111: Use clk_disable_unprepare

2016-07-20 Thread Amitoj Kaur Chawla
Replace clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla --- arch/arm/common/sa.c | 3

[PATCH v2] 2c: mv64xxx: Use clk_enable_prepare and clk_disable_unprepare

2016-07-19 Thread Amitoj Kaur Chawla
; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- Changes in v2: -Rebased patch drivers/i2c/busses/i2c-mv64xxx.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drive

[PATCH v2] 2c: mv64xxx: Use clk_enable_prepare and clk_disable_unprepare

2016-07-19 Thread Amitoj Kaur Chawla
; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Rebased patch drivers/i2c/busses/i2c-mv64xxx.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b

[PATCH] Coccinelle: Script to use roundup and DIV_ROUND_UP

2016-07-14 Thread Amitoj Kaur Chawla
This script replaces manual calculations by using the predefined macros in kernel.h, DIV_ROUND_UP and roundup for readability purposes. Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- scripts/coccinelle/api/roundup.cocci | 215 +++ 1 file change

[PATCH] Coccinelle: Script to use roundup and DIV_ROUND_UP

2016-07-14 Thread Amitoj Kaur Chawla
This script replaces manual calculations by using the predefined macros in kernel.h, DIV_ROUND_UP and roundup for readability purposes. Signed-off-by: Amitoj Kaur Chawla --- scripts/coccinelle/api/roundup.cocci | 215 +++ 1 file changed, 215 insertions(+) create

[PATCH v2] sound: oss: Remove useless initialisation

2016-07-11 Thread Amitoj Kaur Chawla
Remove useless initialisation of variable whose value is reinitialised later. The Coccinelle semantic patch used to make this change is as follows: @@ type T; identifier x; constant C; expression e; @@ T x - = C ; x = e; Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- C

[PATCH v2] sound: oss: Remove useless initialisation

2016-07-11 Thread Amitoj Kaur Chawla
Remove useless initialisation of variable whose value is reinitialised later. The Coccinelle semantic patch used to make this change is as follows: @@ type T; identifier x; constant C; expression e; @@ T x - = C ; x = e; Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Modify

[PATCH] sound: oss: Remove useless initialisation

2016-07-11 Thread Amitoj Kaur Chawla
@@ type T; identifier x; constant C; expression e; @@ T x - = C ; x = e; Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- sound/oss/ad1848.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 10c8de1..6368e5c

[PATCH] sound: oss: Remove useless initialisation

2016-07-11 Thread Amitoj Kaur Chawla
@@ type T; identifier x; constant C; expression e; @@ T x - = C ; x = e; Signed-off-by: Amitoj Kaur Chawla --- sound/oss/ad1848.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 10c8de1..6368e5c 100644 --- a/sound/oss/ad1848.c

Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
On Mon, Jul 4, 2016 at 8:36 PM, Amitoj Kaur Chawla <amitoj1...@gmail.com> wrote: > On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown <broo...@kernel.org> wrote: >> On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote: >>> On Mon, 4 Jul 2016, Mark Brown wrote: >

Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
On Mon, Jul 4, 2016 at 8:36 PM, Amitoj Kaur Chawla wrote: > On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown wrote: >> On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote: >>> On Mon, 4 Jul 2016, Mark Brown wrote: >> >>> > Please use subject lines

Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown wrote: > On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote: >> On Mon, 4 Jul 2016, Mark Brown wrote: > >> > Please use subject lines matching the style for the subsystem. This >> > makes it easier for people to identify

Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown wrote: > On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote: >> On Mon, 4 Jul 2016, Mark Brown wrote: > >> > Please use subject lines matching the style for the subsystem. This >> > makes it easier for people to identify relevant patches. > >>

[PATCH] ASOC: atmel-pdmic: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- sound/soc

[PATCH] ASOC: atmel-pdmic: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla --- sound/soc/atmel/atmel-pdmic.c | 5

[PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- sound/soc

[PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla --- sound/soc/atmel/atmel-classd.c | 5

[PATCH] crypto: bfin_crc: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/

[PATCH] crypto: bfin_crc: Simplify use of devm_ioremap_resource

2016-07-04 Thread Amitoj Kaur Chawla
= platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // Signed-off-by: Amitoj Kaur Chawla --- drivers/crypto/bfin_crc.c | 5 - 1

[PATCH] RDMA/cxgb3: Use AF_INET for sin_family field

2016-07-04 Thread Amitoj Kaur Chawla
== - PF_INET + AF_INET | sip.sin_family != - PF_INET + AF_INET | sip.sin_family = - PF_INET + AF_INET ) // Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/infiniband/hw/cxgb3/iwch_cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infi

[PATCH] RDMA/cxgb3: Use AF_INET for sin_family field

2016-07-04 Thread Amitoj Kaur Chawla
== - PF_INET + AF_INET | sip.sin_family != - PF_INET + AF_INET | sip.sin_family = - PF_INET + AF_INET ) // Signed-off-by: Amitoj Kaur Chawla --- drivers/infiniband/hw/cxgb3/iwch_cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b

[PATCH] bcache: Use setup_timer and mod_timer

2016-06-30 Thread Amitoj Kaur Chawla
; | -init_timer(); +setup_timer(,f,d); | -init_timer_on_stack(); +setup_timer_on_stack(,f,d); ) <... when != S1 t.x1 = e1; ...> Also convert calls to add_timer and intialisation of timer's expire field to a call to mod_timer which is more compact. Signed-off-by: Amitoj Kaur Chawla &l

[PATCH] bcache: Use setup_timer and mod_timer

2016-06-30 Thread Amitoj Kaur Chawla
; | -init_timer(); +setup_timer(,f,d); | -init_timer_on_stack(); +setup_timer_on_stack(,f,d); ) <... when != S1 t.x1 = e1; ...> Also convert calls to add_timer and intialisation of timer's expire field to a call to mod_timer which is more compact. Signed-off-by: Amitoj Kaur Chawla --- driv

[PATCH] atm: horizon: Use setup_timer

2016-06-30 Thread Amitoj Kaur Chawla
; | -init_timer(); +setup_timer(,f,d); | -init_timer_on_stack(); +setup_timer_on_stack(,f,d); ) <... when != S1 t.x1 = e1; ...> Signed-off-by: Amitoj Kaur Chawla <amitoj1...@gmail.com> --- drivers/atm/horizon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/atm

[PATCH] atm: horizon: Use setup_timer

2016-06-30 Thread Amitoj Kaur Chawla
; | -init_timer(); +setup_timer(,f,d); | -init_timer_on_stack(); +setup_timer_on_stack(,f,d); ) <... when != S1 t.x1 = e1; ...> Signed-off-by: Amitoj Kaur Chawla --- drivers/atm/horizon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/atm/horizon.c b/drivers/atm/hor

  1   2   3   4   >