Skip to content

Commit fee8edd

Browse files
ananglkartben
authored andcommitted
drivers: display_st7567: Fix unintialized variable warning
Theoretically (if either `height` or `width` in `config` is set to 0), the `ret` variable might be returned from `st7567_clear()` without being initialized. Add initialization of this variable to avoid compiler warnings. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
1 parent 1f21bb9 commit fee8edd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/display/display_st7567.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static int st7567_reset(const struct device *dev)
338338
static int st7567_clear(const struct device *dev)
339339
{
340340
const struct st7567_config *config = dev->config;
341-
int ret;
341+
int ret = 0;
342342
uint8_t buf = 0;
343343

344344
uint8_t cmd_buf[] = {

0 commit comments

Comments
 (0)