linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/hfi1: remove redundant assignment to variable ret
@ 2019-11-22 15:48 Colin King
  2019-11-22 17:54 ` Dennis Dalessandro
  2019-11-22 20:26 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-11-22 15:48 UTC (permalink / raw)
  To: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford,
	Jason Gunthorpe, linux-rdma
  Cc: kernel-janitors, linux-kernel

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);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/hfi1: remove redundant assignment to variable ret
  2019-11-22 15:48 [PATCH] IB/hfi1: remove redundant assignment to variable ret Colin King
@ 2019-11-22 17:54 ` Dennis Dalessandro
  2019-11-22 20:26 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Dennis Dalessandro @ 2019-11-22 17:54 UTC (permalink / raw)
  To: Colin King, Mike Marciniszyn, Doug Ledford, Jason Gunthorpe, linux-rdma
  Cc: kernel-janitors, linux-kernel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/hfi1: remove redundant assignment to variable ret
  2019-11-22 15:48 [PATCH] IB/hfi1: remove redundant assignment to variable ret Colin King
  2019-11-22 17:54 ` Dennis Dalessandro
@ 2019-11-22 20:26 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2019-11-22 20:26 UTC (permalink / raw)
  To: Colin King
  Cc: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford, linux-rdma,
	kernel-janitors, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-22 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 15:48 [PATCH] IB/hfi1: remove redundant assignment to variable ret Colin King
2019-11-22 17:54 ` Dennis Dalessandro
2019-11-22 20:26 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).