diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2016-10-31 14:39:30 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-07 11:05:47 +0100 |
commit | 6d5f49a9f618806e2826d66215bd38c4dd9b3d16 (patch) | |
tree | 54324a221d53fb2d7852876b71d9a36cf00e571c | |
parent | d10543ec14154c492bbc530575990fa00c6c7fd5 (diff) |
staging: vchiq_arm: remove hardcoded buffer length
We better use sizeof instead of hardcoding buffer length multiple
times. This make it easier to increase the buffer in the future.
In order to keep below 80 chars limit make the variable name shorter.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 |
1 files changed, 4 insertions, 4 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 3bc14904e62a..6ea8f1335b78 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2126,20 +2126,20 @@ static void output_timeout_error(VCHIQ_STATE_T *state) { VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); - char service_err[50] = ""; + char err[50] = ""; int vc_use_count = arm_state->videocore_use_count; int active_services = state->unused_service; int i; if (!arm_state->videocore_use_count) { - snprintf(service_err, 50, " Videocore usecount is 0"); + snprintf(err, sizeof(err), " Videocore usecount is 0"); goto output_msg; } for (i = 0; i < active_services; i++) { VCHIQ_SERVICE_T *service_ptr = state->services[i]; if (service_ptr && service_ptr->service_use_count && (service_ptr->srvstate != VCHIQ_SRVSTATE_FREE)) { - snprintf(service_err, 50, " %c%c%c%c(%d) service has " + snprintf(err, sizeof(err), " %c%c%c%c(%d) service has " "use count %d%s", VCHIQ_FOURCC_AS_4CHARS( service_ptr->base.fourcc), service_ptr->client_id, @@ -2153,7 +2153,7 @@ output_timeout_error(VCHIQ_STATE_T *state) output_msg: vchiq_log_error(vchiq_susp_log_level, "timed out waiting for vc suspend (%d).%s", - arm_state->autosuspend_override, service_err); + arm_state->autosuspend_override, err); } |