linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/hfi1: Remove redundant variable rcd
@ 2021-04-25 10:31 Jiapeng Chong
  2021-04-27 18:19 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-04-25 10:31 UTC (permalink / raw)
  To: mike.marciniszyn
  Cc: dennis.dalessandro, dledford, jgg, linux-rdma, linux-kernel,
	Jiapeng Chong

Variable rcd is being assigned a value from a calculation
however the variable is never read, so this redundant variable
can be removed.

Cleans up the following clang-analyzer warning:

drivers/infiniband/hw/hfi1/affinity.c:986:3: warning: Value stored to
'rcd' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/infiniband/hw/hfi1/affinity.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c
index 04b1e8f..ae9a335 100644
--- a/drivers/infiniband/hw/hfi1/affinity.c
+++ b/drivers/infiniband/hw/hfi1/affinity.c
@@ -983,7 +983,6 @@ void hfi1_put_irq_affinity(struct hfi1_devdata *dd,
 			set = &entry->rcv_intr;
 		break;
 	case IRQ_NETDEVCTXT:
-		rcd = (struct hfi1_ctxtdata *)msix->arg;
 		set = &entry->def_intr;
 		break;
 	default:
-- 
1.8.3.1


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

* Re: [PATCH] IB/hfi1: Remove redundant variable rcd
  2021-04-25 10:31 [PATCH] IB/hfi1: Remove redundant variable rcd Jiapeng Chong
@ 2021-04-27 18:19 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-04-27 18:19 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: mike.marciniszyn, dennis.dalessandro, dledford, linux-rdma, linux-kernel

On Sun, Apr 25, 2021 at 06:31:36PM +0800, Jiapeng Chong wrote:
> Variable rcd is being assigned a value from a calculation
> however the variable is never read, so this redundant variable
> can be removed.
> 
> Cleans up the following clang-analyzer warning:
> 
> drivers/infiniband/hw/hfi1/affinity.c:986:3: warning: Value stored to
> 'rcd' is never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/hfi1/affinity.c | 1 -
>  1 file changed, 1 deletion(-)

Applied to for-next, though I also moved the rcd variable into the
only scope that used it.

Jason

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

end of thread, other threads:[~2021-04-27 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 10:31 [PATCH] IB/hfi1: Remove redundant variable rcd Jiapeng Chong
2021-04-27 18:19 ` 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).