ipc_service: backends: icbmsg: Silence maybe-uninitialized warning

If compiling with optimizations (-O2/-Ofast) gcc emits a
maybe-uninitialized warning for `size`.

As far as I can tell, `size` will always be initialized in the cases
where it is used and only left uninitialized in error cases.

Reproduced on main with the multi_endpoint sample on
nrf5340dk/nrf5340/cpuapp.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
This commit is contained in:
Herman Berget 2024-04-18 14:30:02 +02:00 committed by Carles Cufí
parent d3cfbf1ae1
commit 9729651bb5

View file

@ -461,7 +461,7 @@ static int release_tx_buffer(struct backend_data *dev_data, const uint8_t *buffe
int new_size)
{
const struct icbmsg_config *conf = dev_data->conf;
size_t size;
size_t size = 0;
int tx_block_index;
tx_block_index = buffer_to_index_validate(&conf->tx, buffer, &size);