Skip to content

Commit 66aefdb

Browse files
dcpleunggalak
authored andcommitted
samples: intel_s1000/i2s: fix uninitialized use warning
One of the return variable is declared and used, but never assigned values. So fix it. Signed-off-by: Daniel Leung <[email protected]>
1 parent c6f4a97 commit 66aefdb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

samples/boards/intel_s1000_crb/i2s/src/i2s_sample.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ static void i2s_stop_audio(void)
292292
{
293293
int ret;
294294

295-
if (i2s_trigger(spk_i2s_dev, I2S_DIR_TX, I2S_TRIGGER_STOP)) {
295+
ret = i2s_trigger(spk_i2s_dev, I2S_DIR_TX, I2S_TRIGGER_STOP);
296+
if (ret) {
296297
LOG_ERR("spk_i2s_dev stop failed with code %d", ret);
297298
}
298299

299-
if (i2s_trigger(host_i2s_dev, I2S_DIR_RX, I2S_TRIGGER_STOP)) {
300+
ret = i2s_trigger(host_i2s_dev, I2S_DIR_RX, I2S_TRIGGER_STOP);
301+
if (ret) {
300302
LOG_ERR("host_i2s_dev stop failed with code %d", ret);
301303
}
302304

0 commit comments

Comments
 (0)