* [PATCH] IB/qib: Remove redundant assignment to ret
@ 2021-04-29 10:42 Yang Li
2021-04-30 14:28 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-04-29 10:42 UTC (permalink / raw)
To: dennis.dalessandro
Cc: mike.marciniszyn, dledford, jgg, nathan, ndesaulniers, linux-rdma,
linux-kernel, clang-built-linux, Yang Li
Variable 'ret' is set to zero but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed
Clean up the following clang-analyzer warning:
drivers/infiniband/hw/qib/qib_sd7220.c:690:2: warning: Value stored to
'ret' is never read [clang-analyzer-deadcode.DeadStores]
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/infiniband/hw/qib/qib_sd7220.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/hw/qib/qib_sd7220.c b/drivers/infiniband/hw/qib/qib_sd7220.c
index 4f4a09c..81b810d 100644
--- a/drivers/infiniband/hw/qib/qib_sd7220.c
+++ b/drivers/infiniband/hw/qib/qib_sd7220.c
@@ -687,7 +687,6 @@ static int qib_sd7220_reg_mod(struct qib_devdata *dd, int sdnum, u32 loc,
spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags);
return -1;
}
- ret = 0;
for (tries = EPB_TRANS_TRIES; tries; --tries) {
transval = qib_read_kreg32(dd, trans);
if (transval & EPB_TRANS_RDY)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] IB/qib: Remove redundant assignment to ret
2021-04-29 10:42 [PATCH] IB/qib: Remove redundant assignment to ret Yang Li
@ 2021-04-30 14:28 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-04-30 14:28 UTC (permalink / raw)
To: Yang Li
Cc: dennis.dalessandro, mike.marciniszyn, dledford, nathan,
ndesaulniers, linux-rdma, linux-kernel, clang-built-linux
On Thu, Apr 29, 2021 at 06:42:20PM +0800, Yang Li wrote:
> Variable 'ret' is set to zero but this value is never read as it is
> overwritten with a new value later on, hence it is a redundant
> assignment and can be removed
>
> Clean up the following clang-analyzer warning:
>
> drivers/infiniband/hw/qib/qib_sd7220.c:690:2: warning: Value stored to
> 'ret' is never read [clang-analyzer-deadcode.DeadStores]
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/infiniband/hw/qib/qib_sd7220.c | 1 -
> 1 file changed, 1 deletion(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-30 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-29 10:42 [PATCH] IB/qib: Remove redundant assignment to ret Yang Li
2021-04-30 14:28 ` 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).