2021-06-05 13:15:35

by Colin King

[permalink] [raw]
Subject: [PATCH][next] RDMA/irdma: remove redundant initialization of variable val

From: Colin Ian King <[email protected]>

The variable val is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/infiniband/hw/irdma/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
index 8bd3aecadaf6..b1023a7d0bd1 100644
--- a/drivers/infiniband/hw/irdma/ctrl.c
+++ b/drivers/infiniband/hw/irdma/ctrl.c
@@ -3323,7 +3323,7 @@ __le64 *irdma_sc_cqp_get_next_send_wqe_idx(struct irdma_sc_cqp *cqp, u64 scratch
*/
enum irdma_status_code irdma_sc_cqp_destroy(struct irdma_sc_cqp *cqp)
{
- u32 cnt = 0, val = 1;
+ u32 cnt = 0, val;
enum irdma_status_code ret_code = 0;

writel(0, cqp->dev->hw_regs[IRDMA_CCQPHIGH]);
--
2.31.1


2021-06-07 14:55:43

by Shiraz Saleem

[permalink] [raw]
Subject: RE: [PATCH][next] RDMA/irdma: remove redundant initialization of variable val

> Subject: [PATCH][next] RDMA/irdma: remove redundant initialization of variable val
>
> From: Colin Ian King <[email protected]>
>
> The variable val is being initialized with a value that is never read, it is being
> updated later on. The assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/infiniband/hw/irdma/ctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
> index 8bd3aecadaf6..b1023a7d0bd1 100644
> --- a/drivers/infiniband/hw/irdma/ctrl.c
> +++ b/drivers/infiniband/hw/irdma/ctrl.c
> @@ -3323,7 +3323,7 @@ __le64 *irdma_sc_cqp_get_next_send_wqe_idx(struct
> irdma_sc_cqp *cqp, u64 scratch
> */
> enum irdma_status_code irdma_sc_cqp_destroy(struct irdma_sc_cqp *cqp) {
> - u32 cnt = 0, val = 1;
> + u32 cnt = 0, val;

Acked-by: Shiraz Saleem <[email protected]>

2021-06-07 23:48:46

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH][next] RDMA/irdma: remove redundant initialization of variable val

On Sat, Jun 05, 2021 at 02:13:47PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The variable val is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> Acked-by: Shiraz Saleem <[email protected]>
> ---
> drivers/infiniband/hw/irdma/ctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason