diff options
author | Stefan Wahren | 2018-04-28 17:47:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2018-05-07 04:04:43 +0200 |
commit | 0b134c5d7e60b4b9e6fbcd5f6d4cba5b6da4a189 (patch) | |
tree | 1e1e48efbe7105dd103ccb8b0a75c2b31cf72cb6 /drivers/staging/vc04_services | |
parent | staging: vchiq_arm: Clear VLA warning (diff) | |
download | kernel-qcow2-linux-0b134c5d7e60b4b9e6fbcd5f6d4cba5b6da4a189.tar.gz kernel-qcow2-linux-0b134c5d7e60b4b9e6fbcd5f6d4cba5b6da4a189.tar.xz kernel-qcow2-linux-0b134c5d7e60b4b9e6fbcd5f6d4cba5b6da4a189.zip |
staging: vchiq_arm: Rework second abort criterion
In order to make the code easier to review, move the second
abort criterion into the loop and the incrementation into
a separate line.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services')
-rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 7 |
1 files changed, 5 insertions, 2 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 d46a5b860d6f..01fcd15af8a1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -3455,7 +3455,7 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state) if (active_services > MAX_SERVICES) only_nonzero = 1; - for (i = 0; (i < active_services) && (j < MAX_SERVICES); i++) { + for (i = 0; i < active_services; i++) { VCHIQ_SERVICE_T *service_ptr = state->services[i]; if (!service_ptr) @@ -3469,7 +3469,10 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state) 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; + service_data[j].use_count = service_ptr->service_use_count; + j++; + if (j >= MAX_SERVICES) + break; } read_unlock_bh(&arm_state->susp_res_lock); |