[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 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] 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] atm: horizon: Use setup_timer

2016-06-30 Thread Amitoj Kaur Chawla
n = f; | -init_timer(&t); +setup_timer(&t,f,d); | -init_timer_on_stack(&t); +setup_timer_on_stack(&t,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/

[PATCH] net: ethernet: tundra: Correct argument for pci_free_consistent

2016-06-27 Thread Amitoj Kaur Chawla
pci_free_consistent's argument 'struct pci_dev' should be NULL not 0. The Coccinelle semantic patch used to make this change is as follows: @@ @@ pci_free_consistent( - 0 + NULL , ...) Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/tundra/tsi108_eth.c | 3 ++- 1

[PATCH] caif: Remove unneeded header file

2016-06-23 Thread Amitoj Kaur Chawla
Drop redundant include of moduleparam.h The Coccinelle semantic patch used to make this change is as follows: @ includesmodule @ @@ #include @ depends on includesmodule @ @@ - #include Signed-off-by: Amitoj Kaur Chawla --- net/caif/chnl_net.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH] i40e: Remove redundant memset

2016-06-22 Thread Amitoj Kaur Chawla
Remove redundant call to memset before a call to memcpy. The Coccinelle semantic patch used to make this change is as follows: @@ expression e1,e2,e3,e4; @@ - memset(e1,e2,e3); memcpy(e1,e4,e3); Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 - 1 file

[PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-22 Thread Amitoj Kaur Chawla
- memcpy(to, from, size); Signed-off-by: Amitoj Kaur Chawla --- net/tipc/server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/tipc/server.c b/net/tipc/server.c index 2446bfb..38a6f33 100644 --- a/net/tipc/server.c +++ b/net/tipc/server.c @@ -411,13 +411,12 @@ static

[PATCH] net: cavium: liquidio: Use vzalloc instead of vmalloc

2016-06-17 Thread Amitoj Kaur Chawla
: Amitoj Kaur Chawla --- drivers/net/ethernet/cavium/liquidio/octeon_device.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c index f67641a..2bf90c1 100644 --- a

[PATCH] qlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue

2016-04-09 Thread Amitoj Kaur Chawla
alloc_ordered_workqueue. WQ_MEM_RECLAIM flag has been set since ethernet devices seem to sit in memory reclaim path, so to guarantee forward progress regardless of memory pressure. Signed-off-by: Amitoj Kaur Chawla Acked-by: Tejun Heo --- Not sure if the assumption of requiring ordering of work items

[PATCH] can: mcp251x: Replace create_freezable_workqueue with alloc_workqueue

2016-04-08 Thread Amitoj Kaur Chawla
is required. WQ_MEM_RECLAIM flag has been set here to ensure forward progress regardless of memory pressure. The order of execution is not important so set @max_active as 0. Signed-off-by: Amitoj Kaur Chawla Acked-by: Tejun Heo --- drivers/net/can/spi/mcp251x.c | 3 ++- 1 file changed

Re: [PATCH] wan: lmc: Switch to using managed resources

2016-03-02 Thread Amitoj Kaur Chawla
On Wed, Mar 2, 2016 at 3:51 AM, David Miller wrote: > From: Amitoj Kaur Chawla > Date: Sat, 27 Feb 2016 22:34:16 +0530 > >> @@ -835,23 +835,20 @@ static int lmc_init_one(struct pci_dev *pdev, const >> struct pci_device_id *ent) >> err = pci_request_regions(pde

Re: [PATCH 3/3] 3c59x: Use setup_timer()

2016-02-28 Thread Amitoj Kaur Chawla
On Sun, Feb 28, 2016 at 1:23 PM, Stafford Horne wrote: > > > On Sun, 28 Feb 2016, Amitoj Kaur Chawla wrote: > >> On Sun, Feb 28, 2016 at 12:18 AM, Stafford Horne wrote: >> > >> > >> > On Thu, 25 Feb 2016, David Miller wrote: >> > >> >

Re: [PATCH 3/3] 3c59x: Use setup_timer()

2016-02-27 Thread Amitoj Kaur Chawla
On Sun, Feb 28, 2016 at 12:18 AM, Stafford Horne wrote: > > > On Thu, 25 Feb 2016, David Miller wrote: > >> From: Amitoj Kaur Chawla >> Date: Wed, 24 Feb 2016 19:28:19 +0530 >> >>> Convert a call to init_timer and accompanying intializations of >>>

[PATCH] wan: lmc: Switch to using managed resources

2016-02-27 Thread Amitoj Kaur Chawla
. Also, `sc` was only being freed in the probe function and not the remove function before the change. By using devm_kzalloc this patch also fixes this memory leak. Signed-off-by: Amitoj Kaur Chawla --- I was not able to find anywhere that `sc` might be freed. However, if a free has been overlooked

[PATCH] netxen: Use kobj_to_dev()

2016-02-24 Thread Amitoj Kaur Chawla
Introduce the use of kobj_to_dev() helper function instead of open coding it with container_of() The Coccinelle semantic patch used to make this change is as follows: // @@ expression a; symbol kobj; @@ - container_of(a, struct device, kobj) + kobj_to_dev(a) // Signed-off-by: Amitoj Kaur Chawla

[PATCH 3/3] 3c59x: Use setup_timer()

2016-02-24 Thread Amitoj Kaur Chawla
; -t.function = f; // Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/3com/3c59x.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 79e1a02..c377607 100644 --- a/drivers/net/

[PATCH 2/3] forcedeth: Use setup_timer()

2016-02-24 Thread Amitoj Kaur Chawla
.function = f; // Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/nvidia/forcedeth.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 75e88f4..9b0d7f4 100644 --- a/drivers

[PATCH 1/3] net: tulip: Use setup_timer()

2016-02-24 Thread Amitoj Kaur Chawla
.function = f; // Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/dec/tulip/tulip_core.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c index b553409..94d0eeb

Re: [PATCH] ehea: Drop owner assignment from platform_driver

2016-02-19 Thread Amitoj Kaur Chawla
On Fri, Feb 19, 2016 at 5:05 PM, Thadeu Lima de Souza Cascardo wrote: > NACK. > > ehea does not use platform_driver_register, it uses > ibmebus_register_driver, which does not set owner. > > Cascardo. Thanks for the feedback. I'll make sure to check for this in the future. Amitoj

[PATCH] ehea: Drop owner assignment from platform_driver

2016-02-19 Thread Amitoj Kaur Chawla
platform_driver does not need to set an owner, it will be populated by the driver core. Generated-by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/ibm/ehea/ehea_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers

[PATCH v2] lance: Return correct error code

2016-02-17 Thread Amitoj Kaur Chawla
ould be written "!lp" Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Modified commit message to properly describe the change. drivers/net/ethernet/amd/lance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amd/lance.c b/dr

Re: [PATCH] lance: Return correct error code

2016-02-17 Thread Amitoj Kaur Chawla
On Wed, Feb 17, 2016 at 7:46 PM, Sergei Shtylyov wrote: > Hello. > > On 2/17/2016 4:35 PM, Amitoj Kaur Chawla wrote: > >> The return value of kzalloc on failure should be -ENOMEM and > > >kzalloc() returns NULL on failure! You need to clarify your patch > desc

[PATCH] lance: Return correct error code

2016-02-17 Thread Amitoj Kaur Chawla
en "!lp" Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/amd/lance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c index 256f590..3a7ebfd 100644 --- a/drivers/net/ethernet/amd/lance.c

[PATCH] mwifiex: Use to_delayed_work()

2016-02-17 Thread Amitoj Kaur Chawla
-off-by: Amitoj Kaur Chawla --- drivers/net/wireless/marvell/mwifiex/11h.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/11h.c b/drivers/net/wireless/marvell/mwifiex/11h.c index 71a1b58..81c60d0 100644 --- a/drivers/net/wireless

[PATCH] net: hamradio: baycom_ser_fdx: Replace timeval with timespec64

2016-02-09 Thread Amitoj Kaur Chawla
. We only need to find elapsed microseconds rather than absolute time, so it's better to use monotonic time, so using ktime_get_ts64() makes the code more efficient and more robust against concurrent settimeofday() calls. Signed-off-by: Amitoj Kaur Chawla Reviewed-by: Arnd Bergmann --- dr

[PATCH] dmascc: Return correct error codes

2016-02-09 Thread Amitoj Kaur Chawla
This change has been made with the goal that kernel functions should return something more descriptive than -1 on failure. A variable `err` has been introduced for storing error codes. The return value of kzalloc on failure should return a -1 and not a -ENOMEM. This was found using Coccinelle. A

[PATCH] bonding: Return correct error code

2016-02-06 Thread Amitoj Kaur Chawla
that the return value is not 0, hence no change is required at the call site. Signed-off-by: Amitoj Kaur Chawla --- drivers/net/bonding/bond_alb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index bb9e9fc

[PATCH 1/3] net: cavium: liquidio: Return correct error code

2016-02-04 Thread Amitoj Kaur Chawla
The return value of vmalloc on failure of allocation of memory should be -ENOMEM and not -1. Found using Coccinelle. A simplified version of the semantic patch used is: // @@ expression *e; identifier l1; position p,q; @@ e@q = vmalloc(...); if@p (e == NULL) { ... goto l1; } l1: ... return -1 +

[PATCH 2/3] ibmveth: Return correct error codes

2016-02-04 Thread Amitoj Kaur Chawla
+ -ENOMEM ; } // The two call sites only check that the return value is not 0, hence no change is required at the call sites. Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/ibm/ibmveth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm

[PATCH 3/3] net: mvpp2: Return correct error codes

2016-02-04 Thread Amitoj Kaur Chawla
may also return -1 after calling mpp2_prs_tcam_port_map_get. So that the function consistently returns meaningful error values on failure, the -1 is changed to -EINVAL. Signed-off-by: Amitoj Kaur Chawla --- drivers/net/ethernet/marvell/mvpp2.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] isdn: Remove unnecessary cast in kfree

2016-01-26 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/isdn/hisax/fsm.c | 2 +- drivers/isdn/mISDN/fsm.c | 2