diff mbox

[1/2] IB/qib: remove redundant setting of any in for-loop

Message ID 20171114212936.17403.34341.stgit@phlsvslse11.ph.intel.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Marciniszyn, Mike Nov. 14, 2017, 9:29 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable all is being set but is never read after this
hence it can be removed from the for loop initialization.
Cleans up clang warning:

drivers/infiniband/hw/qib/qib_file_ops.c:640:7: warning: Value
stored to 'any' is never read

Tested-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
---
 drivers/infiniband/hw/qib/qib_file_ops.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jason Gunthorpe Dec. 11, 2017, 11:37 p.m. UTC | #1
On Tue, Nov 14, 2017 at 04:29:36PM -0500, Mike Marciniszyn wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable all is being set but is never read after this
> hence it can be removed from the for loop initialization.
> Cleans up clang warning:
> 
> drivers/infiniband/hw/qib/qib_file_ops.c:640:7: warning: Value
> stored to 'any' is never read
> 
> Tested-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
>  drivers/infiniband/hw/qib/qib_file_ops.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied this series to for-next

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 9396c18..b25571f 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -637,7 +637,7 @@  static int qib_set_part_key(struct qib_ctxtdata *rcd, u16 key)
 		ret = -EBUSY;
 		goto bail;
 	}
-	for (any = i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) {
+	for (i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) {
 		if (!ppd->pkeys[i] &&
 		    atomic_inc_return(&ppd->pkeyrefs[i]) == 1) {
 			rcd->pkeys[pidx] = key;