Re: [PATCH] mailbox: zynqmp-ipi-mailbox: Add of_node_put() before goto

2019-07-31 Thread Nishka Dasgupta
On 31/07/19 2:01 PM, Michal Simek wrote: On 09. 07. 19 19:28, Nishka Dasgupta wrote: Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before

Re: [PATCH] regulator: of: Add of_node_put() before return in function

2019-07-31 Thread Nishka Dasgupta
On 26/07/19 4:15 PM, Mark Brown wrote: On Fri, Jul 26, 2019 at 01:02:52PM +0530, Nishka Dasgupta wrote: On 24/07/19 9:17 PM, Mark Brown wrote: On Wed, Jul 24, 2019 at 02:02:31PM +0530, Nishka Dasgupta wrote: The local variable search in regulator_of_get_init_node takes the value returned

[PATCH v2] regulator: core: Add of_node_put() before return

2019-08-08 Thread Nishka Dasgupta
child is not put, which may cause a memory leak. Hence create a new label, err_node_put, that puts child and then returns the required value; edit the mid-loop return statements to instead go to this new label. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Create

[PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-08 Thread Nishka Dasgupta
include the statement pm_runtime_disable() under this label in order to avoid repetition among mid-loop return conditions. Edit the mid-loop return statements to instead go to this new label err_node_put. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/phy/qualcomm/phy-qcom

[PATCH v3] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-08 Thread Nishka Dasgupta
include the statement pm_runtime_disable() under this label in order to avoid repetition among mid-loop return conditions. Edit the mid-loop return statements to instead go to this new label err_node_put. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v3: - Add version

[PATCH v2] soc: qcom: smp2p: Add of_node_put() at goto

2019-08-08 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node() puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put() before each mid-loop goto. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] bus: ti-sysc: Remove if-block in sysc_check_children()

2019-08-08 Thread Nishka Dasgupta
In function sysc_check_children, there is an if-statement checking whether the value returned by function sysc_check_one_child is non-zero. However, sysc_check_one_child always returns 0, and hence this check is not needed. Hence remove this if-block. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] sgi-xp: xpc_uv: Make structure xpc_arch_ops_uv constant

2019-08-08 Thread Nishka Dasgupta
-off-by: Nishka Dasgupta --- drivers/misc/sgi-xp/xpc_uv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 0c6de97dd347..89c4b04337d3 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c

[PATCH] mailbox: zynqmp-ipi-mailbox: Add of_node_put() before goto

2019-07-09 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the goto. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] memory: ti-aemif: Add of_node_put() before goto

2019-07-09 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the goto. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/memory

[PATCH] Bluetooth: 6lowpan: Make variable header_ops constant

2019-08-14 Thread Nishka Dasgupta
modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- net/bluetooth/6lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 9d41de1ec90f..bb55d92691b0 100644 --- a/net/bluetooth/6lowpan.c +++ b/net

[PATCH] i2c: stm32f7: Make structure stm32f7_i2c_algo constant

2019-08-14 Thread Nishka Dasgupta
. Signed-off-by: Nishka Dasgupta --- drivers/i2c/busses/i2c-stm32f7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 266d1c269b83..d36cf08461f7 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers

[PATCH] ata: libahci_platform: Add of_node_put() before loop exit

2019-08-15 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Add an of_node_put before three such goto statements. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/ata

[PATCH] bus: arm-cci: Add of_node_put() before break

2019-08-15 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a break from the middle of the loop, there is no put, thus causing a memory leak. Add an of_node_put before the break. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/bus/arm-cci.c | 4

[PATCH] auxdisplay: ht16k33: Make ht16k33_fb_fix and ht16k33_fb_var constant

2019-08-19 Thread Nishka Dasgupta
The static structures ht16k33_fb_fix and ht16k33_fb_var, of types fb_fix_screeninfo and fb_var_screeninfo respectively, are not used except to be copied into other variables. Hence make both of them constant to prevent unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka

[PATCH] staging: media: tegra-vde: Remove variable

2019-05-30 Thread Nishka Dasgupta
Remove unnecessary variable iram_tables and use its value directly. Issue found using Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/media/tegra-vde/tegra-vde.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/tegra-vde/tegra-vde.c

[PATCH] staging: media: davinci_vpfe: Remove variable vpfe_dev

2019-05-30 Thread Nishka Dasgupta
Remove variable vpfe_dev and replace it with its value (since the function otherwise uses values directly instead of local variables). Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/media/davinci_vpfe/vpfe_video.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH] staging: comedi: Remove variable runflags

2019-05-30 Thread Nishka Dasgupta
Remove variable runflags and use its value directly. Issue found with checkpatch. Signed-off-by: Nishka Dasgupta --- drivers/staging/comedi/comedi_fops.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi

[PATCH] staging: rtl8712: Replace function r8712_init_mlme_priv

2019-05-30 Thread Nishka Dasgupta
Delete r8712_init_mlme_priv as it does nothing except call _init_mlme_priv, and rename _init_mlme_priv to r8712_init_mlme_priv. Change the type of the new r8712_init_mlme_priv (formerly _init_mlme_priv) to (non-static) int, from static sint. Signed-off-by: Nishka Dasgupta --- drivers/staging

[PATCH] staging: rtl8712: Replace function r8712_free_network_queue

2019-05-30 Thread Nishka Dasgupta
Remove function r8712_free_network_queue as it does nothing except call _free_network_queue. Rename _free_network_queue to r8712_free_network_queue (and change its type to static) for continued use of the original functionality. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712

[PATCH] staging: rtl8712: Remove function alloc_network

2019-05-30 Thread Nishka Dasgupta
Remove function alloc_network as it does nothing except call _r8712_alloc_network. Further, to maintain consistency with the names of other functions, rename _r8712_alloc_network as r8712_alloc_network. Also change the corresponding calls to either function accordingly. Signed-off-by: Nishka

[PATCH] staging: rtl8712: ieee80211.c: Remove leading p from variable names

2019-05-30 Thread Nishka Dasgupta
Remove leading p from the names of the following pointer variables: - pregistrypriv - pdev_network - pie - pbuf. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/ieee80211.c | 50 ++--- 1 file changed, 25 insertions(+), 25 deletions

[PATCH] staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM

2019-05-30 Thread Nishka Dasgupta
-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl871x_cmd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 8220829b5c82..e408b15102ce 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c

Re: [PATCH] staging: media: davinci_vpfe: Remove variable vpfe_dev

2019-05-30 Thread Nishka Dasgupta
On 31/05/19 2:25 AM, Greg KH wrote: On Fri, May 31, 2019 at 02:17:18AM +0530, Nishka Dasgupta wrote: Remove variable vpfe_dev and replace it with its value (since the function otherwise uses values directly instead of local variables). This says _what_ you do. But we can see

Re: [PATCH] staging: comedi: Remove variable runflags

2019-05-31 Thread Nishka Dasgupta
On 31/05/19 3:55 PM, Ian Abbott wrote: On 30/05/2019 21:51, Nishka Dasgupta wrote: Remove variable runflags and use its value directly. Issue found with checkpatch. Signed-off-by: Nishka Dasgupta ---   drivers/staging/comedi/comedi_fops.c | 8 ++--   1 file changed, 2 insertions(+), 6

[PATCH v2] staging: vt6655: Change return type of function and remove variable

2019-05-31 Thread Nishka Dasgupta
Remove return variable bResult from function CARDbRadioPowerOff and change the return type of the function to void as it always returns true and the return value is never stored nor checked when called. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/vt6655

[PATCH] irqchip: irq-mbigen: Add of_node_put() before return

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Add an of_node_put before the return in three places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] net: dsa: sja1105: sja1105_main: Add of_node_put()

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/net/dsa

[PATCH] phy: marvell: phy-armada38x-comphy: Add of_node_put() before return

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] phy: marvell: phy-mvebu-a3700-comphy: Add of_node_put() before return

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] phy: marvell: phy-mvebu-cp110-comphy: Add of_node_put() before return

2019-07-23 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] regulator: of: Add of_node_put() before return in function

2019-07-24 Thread Nishka Dasgupta
with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/regulator/of_regulator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 397918ebba55..9112faa6a9a0 100644 --- a/drivers/regulator/of_regulator.c

[PATCH] staging: pi433: Remove unnecessary return variable

2019-05-23 Thread Nishka Dasgupta
From: Nishka Dasgupta The variable retval is initialised to 0 and assigned a constant value later. Both of these can be returned separately, hence retval can be removed. Signed-off-by: Nishka Dasgupta --- drivers/staging/pi433/pi433_if.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions

[PATCH v2] staging: pi433: Remove unnecessary variable

2019-05-23 Thread Nishka Dasgupta
The variable retval is assigned constant values twice, and can therefore be replaced by its values. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Add Wei Yongjun to the recipients list - Fix From and Signed-off-by fields drivers/staging/pi433/pi433_if.c | 5 ++--- 1 file changed, 2

[PATCH] staging: most: usb: Remove variable frame_size

2019-05-23 Thread Nishka Dasgupta
Remove variable frame_size as its multiple usages are all independent of each other and so can be returned separately. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/most/usb/usb.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff

[PATCH] staging: ks7010: Remove initialisation

2019-05-23 Thread Nishka Dasgupta
The initial value of return variable ret is never used, so it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers

[PATCH] staging: ks7010: Remove initialisation

2019-05-23 Thread Nishka Dasgupta
As the initial value of the return variable result is never used, it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b

[PATCH 1/2] staging: gdm724x: Remove initialisation

2019-05-24 Thread Nishka Dasgupta
The initial value of return variable ret, -1, is never used and hence can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/gdm724x/gdm_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b

[PATCH 2/2] staging: gdm724x: Remove variable

2019-05-24 Thread Nishka Dasgupta
found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/gdm724x/gdm_usb.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index d023f83f9097..8145ae2afba7 100644 --- a/drivers/staging

[PATCH] staging: fieldbus: anybuss: Remove variables

2019-05-24 Thread Nishka Dasgupta
The local variable cd, used in multiple functions, is immediately passed to another function call, whose result is returned. As that is the only use of cd, it can be replaced with its variable. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/fieldbus/anybuss

Re: [PATCH] staging: ks7010: Remove initialisation

2019-05-24 Thread Nishka Dasgupta
On 24/05/19 12:22 PM, Greg KH wrote: On Fri, May 24, 2019 at 11:26:02AM +0530, Nishka Dasgupta wrote: As the initial value of the return variable result is never used, it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/ks7010/ks7010_sdio.c | 2

[PATCH v2] staging: ks7010: Remove initialisation in ks_hostif.c

2019-05-24 Thread Nishka Dasgupta
The initial value of return variable result is never used, so it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Fixed typo in commit message - Clarified subject line to include filename drivers/staging/ks7010/ks_hostif.c | 2 +- 1 file changed

[PATCH v2] staging: ks7010: Remove initialisation in

2019-05-24 Thread Nishka Dasgupta
As the initial value of the return variable result is never used, it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Clarified subject line drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] staging: ks7010: Merge multiple return variables in ks_hostif.c

2019-05-24 Thread Nishka Dasgupta
esult can be removed and its occurrences replaced with ret. Signed-off-by: Nishka Dasgupta --- drivers/staging/ks7010/ks_hostif.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 3775fd4b89ae..266

[PATCH v3] staging: ks7010: Remove initialisation in ks7010_sdio.c

2019-05-24 Thread Nishka Dasgupta
As the initial value of the return variable result is never used, it can be removed. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v3: - Edited subject line and commit message Changes in v2: - Clarified subject line drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1

Re: [PATCH] regulator: of: Add of_node_put() before return in function

2019-07-26 Thread Nishka Dasgupta
On 24/07/19 9:17 PM, Mark Brown wrote: On Wed, Jul 24, 2019 at 02:02:31PM +0530, Nishka Dasgupta wrote: The local variable search in regulator_of_get_init_node takes the value returned by either of_get_child_by_name or of_node_get, both of which get a node. If this node is not put before

Re: [PATCH] mfd: max77620: Add of_node_put() before return

2019-07-26 Thread Nishka Dasgupta
On 25/07/19 5:45 PM, Lee Jones wrote: On Tue, 09 Jul 2019, Nishka Dasgupta wrote: Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return

Re: [PATCH 1/2] staging: rtl8712: r8712_setdatarate_cmd(): Change

2019-06-09 Thread Nishka Dasgupta
/type" or any other descriptive message. What should I do? On Fri, Jun 07, 2019 at 07:36:57PM +0530, Nishka Dasgupta wrote: Change the return values of function r8712_setdatarate_cmd from _SUCCESS and _FAIL to 0 and -ENOMEM respectively. Change the return type of the function from

Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables

2019-06-09 Thread Nishka Dasgupta
On 09/06/19 4:32 PM, Greg KH wrote: On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka Dasgupta wrote: Remove variables that are declared and assigned values but not otherwise used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c

Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables

2019-06-10 Thread Nishka Dasgupta
On 10/06/19 11:19 AM, Greg KH wrote: On Mon, Jun 10, 2019 at 10:08:21AM +0530, Nishka Dasgupta wrote: On 09/06/19 4:32 PM, Greg KH wrote: On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka Dasgupta wrote: Remove variables that are declared and assigned values but not otherwise used. Issue found

Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables

2019-06-10 Thread Nishka Dasgupta
On 10/06/19 12:55 PM, Greg KH wrote: On Mon, Jun 10, 2019 at 12:44:05PM +0530, Nishka Dasgupta wrote: On 10/06/19 11:19 AM, Greg KH wrote: On Mon, Jun 10, 2019 at 10:08:21AM +0530, Nishka Dasgupta wrote: On 09/06/19 4:32 PM, Greg KH wrote: On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka

Re: [PATCH] mailbox: zynqmp-ipi-mailbox: Add of_node_put() before goto

2019-08-01 Thread Nishka Dasgupta
On 31/07/19 7:51 PM, Michal Simek wrote: On 31. 07. 19 15:06, Nishka Dasgupta wrote: On 31/07/19 2:01 PM, Michal Simek wrote: On 09. 07. 19 19:28, Nishka Dasgupta wrote: Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle

[PATCH] staging: octeon-usb: Remove return variable

2019-05-29 Thread Nishka Dasgupta
Remove return variable result and return the value directly. Issue found using Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/octeon-usb/octeon-hcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging

[PATCH] staging: kpc2000: Change to use DIV_ROUND_UP

2019-05-29 Thread Nishka Dasgupta
Use macro DIV_ROUND_UP instead of an equivalent sequence of operations. Signed-off-by: Nishka Dasgupta --- drivers/staging/kpc2000/kpc_dma/fileops.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000

[PATCH] staging: rts5208: Remove negations

2019-05-29 Thread Nishka Dasgupta
be changed to valid_sd_current_prior and valid_sd_speed_prior respectively for greater clarity on the purpose of the functions. Signed-off-by: Nishka Dasgupta --- drivers/staging/rts5208/rtsx_chip.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging

[PATCH] staging: rtl8712: Remove unnecessary variable in rtl8712_recv.c

2019-05-29 Thread Nishka Dasgupta
Remove unnecessary variable last_evm in rtl8712_recv.c and use its value directly. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl8712_recv.c | 5 ++--- drivers/staging/rtl8712/rtl871x_cmd.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions

[PATCH] staging: rtl8712: Remove return variable of different type

2019-05-29 Thread Nishka Dasgupta
The local return variable ret may be replaced directly by its value, especially since its type (uint) is not the same as the function's return type (int). Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 ++-- 1 file changed, 2

[PATCH] staging: rtl8712: Remove initialisations

2019-05-29 Thread Nishka Dasgupta
Remove initialisations of multiple variables as these initial values are never used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl871x_mp.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8712

[PATCH] staging: vt6655: Change return type of function and remove variable

2019-05-29 Thread Nishka Dasgupta
As the function CARDbRadioPowerOff always returns true, and this value does not appear to be used anywhere, the return variable can be entirely removed and the function converted to type void. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/vt6655/card.c | 56

[PATCH] pinctrl: rzn1: Add of_node_put() before return

2019-08-04 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in three places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] regulator: core: Add of_node_put() before return

2019-08-04 Thread Nishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-04 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta

[PATCH] soc: qcom: smp2p: Add of_node_put() at goto

2019-08-04 Thread Nishka Dasgupta
through to the original label. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/soc/qcom/smp2p.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index c7300d54e444..d223e914487d 100644

Re: [PATCH v2] regulator: core: Add of_node_put() before return

2019-08-12 Thread Nishka Dasgupta
On 08/08/19 5:57 PM, Mark Brown wrote: On Thu, Aug 08, 2019 at 12:35:53PM +0530, Nishka Dasgupta wrote: In function of_get_child_regulator(), the loop for_each_child_of_node() contains two mid-loop return statements. Ordinarily the loop gets the node child at the beginning of every iteration

Re: [PATCH] bus: ti-sysc: Remove if-block in sysc_check_children()

2019-08-12 Thread Nishka Dasgupta
On 08/08/19 7:25 PM, Roger Quadros wrote: Nishka, On 08/08/2019 10:40, Nishka Dasgupta wrote: In function sysc_check_children, there is an if-statement checking whether the value returned by function sysc_check_one_child is non-zero. However, sysc_check_one_child always returns 0, and hence

Re: [PATCH] bus: ti-sysc: Remove if-block in sysc_check_children()

2019-08-13 Thread Nishka Dasgupta
On 13/08/19 11:55 AM, Roger Quadros wrote: On 13/08/2019 07:35, Nishka Dasgupta wrote: On 08/08/19 7:25 PM, Roger Quadros wrote: Nishka, On 08/08/2019 10:40, Nishka Dasgupta wrote: In function sysc_check_children, there is an if-statement checking whether the value returned by function

[PATCH v2] bus: ti-sysc: sysc_check_one_child(): Change return type to void

2019-08-13 Thread Nishka Dasgupta
Change return type of function sysc_check_one_child() from int to void as it always returns 0. Accordingly, at its callsite, delete the variable that previously stored the return value. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Remove error variable entirely. - Change return type

Re: [PATCH v2] bus: ti-sysc: sysc_check_one_child(): Change return type to void

2019-08-13 Thread Nishka Dasgupta
On 13/08/19 12:58 PM, Roger Quadros wrote: On 13/08/2019 10:17, Nishka Dasgupta wrote: Change return type of function sysc_check_one_child() from int to void as it always returns 0. Accordingly, at its callsite, delete the variable that previously stored the return value. Signed-off

[PATCH v3 1/2] bus: ti-sysc: sysc_check_one_child(): Change return type to void

2019-08-13 Thread Nishka Dasgupta
Change return type of function sysc_check_one_child() from int to void as it always returns 0. Remove the now-unnecessary return statement as well. Accordingly, at its call site, delete the error variable that previously stored the return value. Signed-off-by: Nishka Dasgupta --- Changes in v3

[PATCH v3 2/2] bus: ti-sysc: sysc_check_children(): Change return type to void

2019-08-13 Thread Nishka Dasgupta
Change return type of function sysc_check_children() from int to void as it always returns 0. Remove its return statement as well. At call site, remove the variable that was used to store the return value, as well as the check on the return value. Signed-off-by: Nishka Dasgupta

[PATCH v2] regulator: core: Add label to collate of_node_put() statements

2019-08-14 Thread Nishka Dasgupta
return blocks to instead go to this new label. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Submit this as a separate patch instead of updating a previous patch. drivers/regulator/core.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/regulator

[PATCH v4] bus: ti-sysc: Change return types of functions

2019-08-14 Thread Nishka Dasgupta
Change return type of functions sysc_check_one_child() and sysc_check_children() from int to void as neither ever returns an error. Modify call sites of both functions accordingly. Signed-off-by: Nishka Dasgupta --- Changes in v4: - Merge into a single patch the two patches

[PATCH] Bluetooth: hci_qca: Make structure qca_proto constant

2019-08-14 Thread Nishka Dasgupta
to qca_proto is declared as constant. Therefore, make qca_proto itself constant as well in order to protect it from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/bluetooth/hci_qca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] staging: rtl8712: hal_init.c: Remove leading p from variable names

2019-06-06 Thread Nishka Dasgupta
Remove the leading p from the following pointer variable names: - padapter - pusb_intf - ppmappedfw - praw - pfwpriv - pdvobj - pregpriv - pmappedfw (not in the same scope as ppmappedfw) - ptmpchar - ppayload - ptx_desc Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers

[PATCH] staging: rtl8712: recv_linux.c: Remove leading p from variable names

2019-06-06 Thread Nishka Dasgupta
Remove leading p from the following pointer variable names: - padapter - pmlmepriv - precv_frame - precvpriv - pfree_recv_queue - pattrib. Issue found with Coccinelle Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/recv_linux.c | 50 ++-- 1 file changed, 25

[PATCH 2/3] staging: rtl8712: usb_ops.c: Remove leading p from variable names

2019-06-06 Thread Nishka Dasgupta
Remove leading 'p' from the names of the following pointer variables: - pintfhdl - pintf_hdl (renamed to intfhdl in keeping with the convention in other functions) - poption - pops - pintfpriv. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/usb_ops.c

[PATCH 1/3] staging: rtl8712: xmit_linux.c: Remove leading p from variable names

2019-06-06 Thread Nishka Dasgupta
Remove leading p from the names of the following pointer variables: - padapter - pxmitpriv - pnetdev - pxmitframe. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/xmit_linux.c | 50 ++-- 1 file changed, 25 insertions(+), 25

[PATCH 3/3] staging: rtl8712: usb_halinit.c: Remove p from variable names

2019-06-06 Thread Nishka Dasgupta
Remove leading 'p' from the names of the following pointer variables: - padapter - precvbuf - pintfhdl - pregistrypriv - precvpriv. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/usb_halinit.c | 288 +- 1 file

[PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables

2019-06-07 Thread Nishka Dasgupta
Remove variables that are declared and assigned values but not otherwise used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c

[PATCH] staging: rtl8723bs: hal: rtl8723b_cmd.c: Remove variables

2019-06-07 Thread Nishka Dasgupta
Remove variables that are declared and initialised but never used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers

[PATCH] staging: rtl8723bs: core: Remove variable priority

2019-06-07 Thread Nishka Dasgupta
Remove local variable change_priority, as it takes the value of the argument priority; as both of these variables are of type u8, priority can be modified without changing the value of its copy at the call site. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging

[PATCH] staging: rtl8723bs: hal: hal_btcoex.c: Remove variable

2019-06-07 Thread Nishka Dasgupta
Remove variable and use the values directly. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging

[PATCH] staging: rtl8723bs: hal: sdio_halinit.c: Remove variables

2019-06-07 Thread Nishka Dasgupta
Remove the variables RegRATR and RegRRSR as they are never used after initialisation and assignment. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging

[PATCH 2/2] staging: rtl8723bs: rtw_os_recvbuf_resource_free(): Change type

2019-06-07 Thread Nishka Dasgupta
Change return type of function rtw_os_recvbuf_resource_free to void as its return value is never stored, checked or otherwise used. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/include/recv_osdep.h | 2 +- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 +- 2 files

[PATCH 1/2] staging: rtl8723bs: rtw_os_recv_resource_alloc(): Change type

2019-06-07 Thread Nishka Dasgupta
Remove assignment of the return value of rtw_os_recv_resource_alloc as this assignment at the call site is never used. Remove return statement from rtw_os_recv_resource_alloc() as its return variable is never used. Change the type of the function to void. Signed-off-by: Nishka Dasgupta

[PATCH] staging: rtl8723bs: os_dep: ioctl_linux.c: Remove return variables

2019-06-07 Thread Nishka Dasgupta
Remove return variables and return the values directly, as the functions all return 0 in all cases. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git

[PATCH 1/2] staging: rtl8712: r8712_setdatarate_cmd(): Change

2019-06-07 Thread Nishka Dasgupta
is not necessary; the return value itself can simply be passed into the conditional.) Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl871x_cmd.c | 8 drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- 3 files

[PATCH 2/2] staging: rtl8712: r8712_createbss_cmd(): Change

2019-06-07 Thread Nishka Dasgupta
will do.) Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8712/rtl871x_cmd.c | 6 +++--- drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712

[PATCH v2] staging: rtl8188eu: core: Replace function rtw_free_network_nolock()

2019-06-07 Thread Nishka Dasgupta
Remove function rtw_free_network_nolock, as all it does is call _rtw_free_network_nolock, and rename _rtw_free_network_nolock to rtw_free_network_nolock. Keep the new rtw_free_network_nolock a static function and remove the old version from the header file. Signed-off-by: Nishka Dasgupta

[PATCH v2] staging: rtl8712: Replace function r8712_free_network_queue

2019-06-04 Thread Nishka Dasgupta
the type of the old r8712_free_network_queue. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Amend commit message for accuracy. drivers/staging/rtl8712/rtl871x_mlme.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging

[PATCH] staging: rtl8188eu: core: Remove initialisation of return variable

2019-06-04 Thread Nishka Dasgupta
Remove initialisation of return variable as it is never used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b

[PATCH] staging: rtl8188eu: core: Replace function rtw_free_network_nolock

2019-06-04 Thread Nishka Dasgupta
Remove function rtw_free_network_nolock, as all it does is call _rtw_free_network_nolock, and rename _rtw_free_network_nolock to rtw_free_network_nolock. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions