Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c35c6af authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman
Browse files

staging: vchiq_core: Simplify VCHIQ init



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: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 244156ca
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -2349,7 +2349,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
	VCHIQ_SHARED_STATE_T *remote;
	VCHIQ_SHARED_STATE_T *remote;
	VCHIQ_STATUS_T status;
	VCHIQ_STATUS_T status;
	char threadname[16];
	char threadname[16];
	static int id;
	int i;
	int i;


	vchiq_log_warning(vchiq_core_log_level,
	vchiq_log_warning(vchiq_core_log_level,
@@ -2437,7 +2436,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,


	memset(state, 0, sizeof(VCHIQ_STATE_T));
	memset(state, 0, sizeof(VCHIQ_STATE_T));


	state->id = id++;
	state->is_master = is_master;
	state->is_master = is_master;


	/*
	/*
@@ -2556,8 +2554,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
	set_user_nice(state->sync_thread, -20);
	set_user_nice(state->sync_thread, -20);
	wake_up_process(state->sync_thread);
	wake_up_process(state->sync_thread);


	BUG_ON(state->id >= VCHIQ_MAX_STATES);
	vchiq_states[0] = state;
	vchiq_states[state->id] = state;


	/* Indicate readiness to the other side */
	/* Indicate readiness to the other side */
	local->initialised = 1;
	local->initialised = 1;