Variable val is not being initialized and is later being read with a potentially garbage value. Fix this by initializing val to zero. Detected by clang scan build: warning: variable 'val' is uninitialized when used here [-Wuninitialized] Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver") Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx> --- drivers/rtc/rtc-rzn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c index 980ade8c9601..0b4bf6e43464 100644 --- a/drivers/rtc/rtc-rzn1.c +++ b/drivers/rtc/rtc-rzn1.c @@ -272,7 +272,7 @@ static int rzn1_rtc_set_offset(struct device *dev, long offset) struct rzn1_rtc *rtc = dev_get_drvdata(dev); unsigned int steps; int stepsh, stepsl; - u32 val; + u32 val = 0; int ret; /* -- 2.35.1