diff mbox series

IB/hfi1: Remove redundant variable rcd

Message ID 1619346696-46300-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series IB/hfi1: Remove redundant variable rcd | expand

Commit Message

Jiapeng Chong April 25, 2021, 10:31 a.m. UTC
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(-)

Comments

Jason Gunthorpe April 27, 2021, 6:19 p.m. UTC | #1
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
diff mbox series

Patch

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: