Skip to content

Commit a1fdeee

Browse files
committed
drivers: modem: initialized variables
This PR is related to the following Zephyr PR: #81431 Some compilers (e.g. arm-zephyr-eabi-gcc) don't understand the K_SPINLOCK() macro and therefore do warn about uninitialized variables in the modem related modules. Signed-off-by: Fabian Kainka <[email protected]>
1 parent 5d74f78 commit a1fdeee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

subsys/modem/modem_cmux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz
11081108
{
11091109
struct modem_cmux_dlci *dlci = (struct modem_cmux_dlci *)data;
11101110
struct modem_cmux *cmux = dlci->cmux;
1111-
int ret;
1111+
int ret = 0;
11121112

11131113
K_SPINLOCK(&cmux->work_lock) {
11141114
if (!cmux->attached) {
@@ -1345,7 +1345,7 @@ int modem_cmux_connect(struct modem_cmux *cmux)
13451345

13461346
int modem_cmux_connect_async(struct modem_cmux *cmux)
13471347
{
1348-
int ret;
1348+
int ret = 0;
13491349

13501350
if (k_event_test(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT)) {
13511351
return -EALREADY;

subsys/modem/modem_pipelink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void modem_pipelink_attach(struct modem_pipelink *link,
2727

2828
bool modem_pipelink_is_connected(struct modem_pipelink *link)
2929
{
30-
bool connected;
30+
bool connected = false;
3131

3232
K_SPINLOCK(&link->spinlock) {
3333
connected = link->connected;

0 commit comments

Comments
 (0)