[PATCH 06/11] staging: vchiq_arm: Make index variable more self-explaining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The chance to mixup i and j is very high. So rename variable j to a more
explaining one.

Signed-off-by: Stefan Wahren <stefan.wahren@xxxxxxxx>
---
 .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index aee721e..1259c26 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -3425,7 +3425,7 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state)
 {
 	VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
 	static struct service_data_struct service_data[64];
-	int i, j = 0;
+	int i, found = 0;
 	/* If there's more than 64 services, only dump ones with
 	 * non-zero counts */
 	int only_nonzero = 0;
@@ -3461,11 +3461,11 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state)
 		if (service_ptr->srvstate == VCHIQ_SRVSTATE_FREE)
 			continue;
 
-		service_data[j].fourcc = service_ptr->base.fourcc;
-		service_data[j].clientid = service_ptr->client_id;
-		service_data[j].use_count = service_ptr->service_use_count;
-		j++;
-		if (j >= ARRAY_SIZE(service_data))
+		service_data[found].fourcc = service_ptr->base.fourcc;
+		service_data[found].clientid = service_ptr->client_id;
+		service_data[found].use_count = service_ptr->service_use_count;
+		found++;
+		if (found >= ARRAY_SIZE(service_data))
 			break;
 	}
 
@@ -3484,7 +3484,7 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state)
 			"with non-zero use-count", active_services,
 			ARRAY_SIZE(service_data));
 
-	for (i = 0; i < j; i++) {
+	for (i = 0; i < found; i++) {
 		vchiq_log_warning(vchiq_susp_log_level,
 			"----- %c%c%c%c:%d service count %d %s",
 			VCHIQ_FOURCC_AS_4CHARS(service_data[i].fourcc),
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux