Re: [PATCH] InfiniBand: Deletion of unnecessary checks before two function calls

2015-07-01 Thread SF Markus Elfring
> From: Markus Elfring > Date: Wed, 19 Nov 2014 19:19:21 +0100 > > The functions kfree() and pci_dev_put() test whether their argument is NULL > and then return immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off

Re: [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following > functions able to tolerate NULL arguments: > > kmem_cache_destroy (commit 3942d29918522) > mempool_destroy (commit 4e3ca3e033d1) > dma_pool_destroy (commit 44d7175da6ea) How do you think about to extend an other SmPL scrip

[PATCH] staging/rdma/hfi1: Delete unnecessary checks before two function calls

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 08:41:00 +0100 The functions "sc_return_credits" and "vfree" perform also input parameter validation. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- driver

[PATCH] staging-EHCA: Delete unnecessary checks before the function call "kmem_cache_destroy"

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 21:58:45 +0100 The kmem_cache_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --

[PATCH 1/1] InfiniBand: Deletion of unnecessary checks before two function calls

2014-11-19 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 19 Nov 2014 19:19:21 +0100 The functions kfree() and pci_dev_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfrin

[PATCH] net: Mellanox: Delete unnecessary checks before the function call "vunmap"

2015-02-04 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 4 Feb 2015 15:17:00 +0100 The vunmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/ethernet/mellanox/mlx4

[PATCH] InfiniBand: Delete unnecessary checks before the function, call "srp_destroy_fr_pool"

2015-02-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Feb 2015 13:20:42 +0100 The srp_destroy_fr_pool() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH v2] net: Mellanox: Delete unnecessary checks before the function call "vunmap"

2015-02-09 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 9 Feb 2015 11:10:41 +0100 The vunmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Eli Cohen --- drivers/net/e

[PATCH 0/6] InfiniBand-ocrdma: Fine-tuning for some function implementations

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 19:30:54 +0100 Several update suggestions were taken into account from static source code analysis. Markus Elfring (6): One variable and jump label less in ocrdma_alloc_ucontext_pd() Delete unnecessary variable initialisations in 11 functions Ret

[PATCH 1/6] InfiniBand-ocrdma: One variable and jump label less in ocrdma_alloc_ucontext_pd()

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 17:16:00 +0100 This issue was detected by using the Coccinelle software. * Let us return directly if a call of the _ocrdma_alloc_pd() function failed. * Delete the jump label "err" and the local variable "status" then. Signed-off-by: Markus Elfring

[PATCH 2/6] InfiniBand-ocrdma: Delete unnecessary variable initialisations in 11 functions

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 18:18:18 +0100 The variable "status" will be set to an appropriate value a bit later. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/infiniband/hw/ocrdma/ocrdma_ah.c| 2 +- drivers/infini

[PATCH 3/6] InfiniBand-ocrdma: Returning only value constants in ocrdma_qp_state_change()

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 18:28:35 +0100 Return zero at the end without using the local variable "status". Signed-off-by: Markus Elfring --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/oc

[PATCH 4/6] InfiniBand-ocrdma: Return a value from a function call in _ocrdma_modify_qp() directly

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 18:40:43 +0100 Return the value from a call of the ocrdma_mbx_modify_qp() function without using an extra assignment for the local variable "status". Signed-off-by: Markus Elfring --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 +--- 1 file chang

[PATCH 5/6] InfiniBand-ocrdma: Returning only value constants in ocrdma_resize_cq()

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 18:54:47 +0100 Return constant integer values without storing them in the local variable "status". Signed-off-by: Markus Elfring --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --gi

[PATCH 6/6] InfiniBand-ocrdma: Delete an unnecessary variable in ocrdma_dealloc_pd()

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 19:09:23 +0100 1. Return zero in one case directly. 2. Return the value from a call of the _ocrdma_dealloc_pd() function without using an extra assignment for the local variable. 3. Remove the variable "status" in this function then. Signed-off-by

[PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in ocrdma_alloc_ucontext_pd()

2015-12-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Dec 2015 22:18:38 +0100 This issue was detected by using the Coccinelle software. * Let us return directly if a call of the _ocrdma_alloc_pd() function failed. * Reduce the scope for the local variable "status" to one case of an if statement. * Delete the

[PATCH 0/2] InfiniBand-iSER: Refactoring for two function implementations

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 13:12:10 +0100 Subject: [PATCH 0/2] InfiniBand-iSER: Refactoring for two function implementations I suggest to return directly instead of using the jump label "err" in two functions (which are working without clean-up there). Markus Elfring (2): One

[PATCH 1/2] InfiniBand-iSER: One jump label less in iser_reg_sig_mr()

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 11:41:42 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the iser_set_sig_attrs() function failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at the end. Signed-off-by:

[PATCH 2/2] InfiniBand-iSER-target: One jump label less in isert_reg_sig_mr()

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 12:54:52 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the function "isert_set_sig_attrs" or "ib_post_send" failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at the e