diff mbox series

IB/hfi1: remove redundant assignment to variable ret

Message ID 20191122154814.87257-1-colin.king@canonical.com (mailing list archive)
State Mainlined
Commit 25d24f4241f7bccdc1978daa026d8847e04a73a6
Delegated to: Jason Gunthorpe
Headers show
Series IB/hfi1: remove redundant assignment to variable ret | expand

Commit Message

Colin King Nov. 22, 2019, 3:48 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable ret is being initialized with a value that is never
read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/infiniband/hw/hfi1/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dennis Dalessandro Nov. 22, 2019, 5:54 p.m. UTC | #1
On 11/22/2019 10:48 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being initialized with a value that is never
> read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/infiniband/hw/hfi1/platform.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/platform.c b/drivers/infiniband/hw/hfi1/platform.c
> index cbf7faa5038c..36593f2efe26 100644
> --- a/drivers/infiniband/hw/hfi1/platform.c
> +++ b/drivers/infiniband/hw/hfi1/platform.c
> @@ -634,7 +634,7 @@ static void apply_tx_lanes(struct hfi1_pportdata *ppd, u8 field_id,
>   			   u32 config_data, const char *message)
>   {
>   	u8 i;
> -	int ret = HCMD_SUCCESS;
> +	int ret;
>   
>   	for (i = 0; i < 4; i++) {
>   		ret = load_8051_config(ppd->dd, field_id, i, config_data);
> 

Thanks.

Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Jason Gunthorpe Nov. 22, 2019, 8:26 p.m. UTC | #2
On Fri, Nov 22, 2019 at 03:48:14PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being initialized with a value that is never
> read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> ---
>  drivers/infiniband/hw/hfi1/platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hfi1/platform.c b/drivers/infiniband/hw/hfi1/platform.c
index cbf7faa5038c..36593f2efe26 100644
--- a/drivers/infiniband/hw/hfi1/platform.c
+++ b/drivers/infiniband/hw/hfi1/platform.c
@@ -634,7 +634,7 @@  static void apply_tx_lanes(struct hfi1_pportdata *ppd, u8 field_id,
 			   u32 config_data, const char *message)
 {
 	u8 i;
-	int ret = HCMD_SUCCESS;
+	int ret;
 
 	for (i = 0; i < 4; i++) {
 		ret = load_8051_config(ppd->dd, field_id, i, config_data);