Skip to content

Commit 11a9096

Browse files
committed
drivers: rtc: ds3231: fix uninitialized variable error
Until recently this driver wasn't built in CI. Now that it is, clang is complaining about `err` possibly being uninitialized in case `bitmask` is 255. Fix it by actually removing code that was unnecessarily trying to access the uninitialized variable. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 8231941 commit 11a9096

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/rtc/rtc_ds3231.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ static int rtc_ds3231_modify_register(const struct device *dev, uint8_t reg, uin
7474
og_buf |= *buf;
7575
*buf = og_buf;
7676
}
77-
if (err != 0) {
78-
return err;
79-
}
8077
err = mfd_ds3231_i2c_set_registers(config->mfd, reg, buf, 1);
8178
return err;
8279
}

0 commit comments

Comments
 (0)