From 7c35c6af0cd6896f6e293cf617a5e27116735e5b Mon Sep 17 00:00:00 2001
From: Stefan Wahren <stefan.wahren@i2se.com>
Date: Fri, 26 May 2017 00:26:19 +0200
Subject: [PATCH] staging: vchiq_core: Simplify VCHIQ init
Git-commit: 7c35c6af0cd6896f6e293cf617a5e27116735e5b
Patch-mainline: v4.13-rc1
References: FATE#324827
Since the ARM side of VCHIQ support only 1 state, we could simplify
the init code. This makes it possible to avoid BUG_ON and a theoretical
overflow of id.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -2342,7 +2342,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
VCHIQ_SHARED_STATE_T *remote;
VCHIQ_STATUS_T status;
char threadname[16];
- static int id;
int i;
vchiq_log_warning(vchiq_core_log_level,
@@ -2430,7 +2429,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
memset(state, 0, sizeof(VCHIQ_STATE_T));
- state->id = id++;
state->is_master = is_master;
/*
@@ -2549,8 +2547,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
set_user_nice(state->sync_thread, -20);
wake_up_process(state->sync_thread);
- BUG_ON(state->id >= VCHIQ_MAX_STATES);
- vchiq_states[state->id] = state;
+ vchiq_states[0] = state;
/* Indicate readiness to the other side */
local->initialised = 1;