]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: rzn1: Fix a variable type
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 20 May 2022 08:25:00 +0000 (10:25 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 24 May 2022 23:24:21 +0000 (01:24 +0200)
commit2d58beb0f73fd9fcca6c3ddf7866da4c6d5a4fff
tree3b31bfafc881a2d0ea5c0b8fa56c25824cca6e39
parenta567923ad2a187d9c37605009824e39d407ff018
rtc: rzn1: Fix a variable type

The calculation in ->set_offset() handles both negative and positive
offsets. The 'steps' variable will be checked to be in a specific [-x;
+x] range, which means it must be a signed integer rather than
unsigned.

This also fixes the following smatch warning:

     warn: 'steps' 'true' implies 'steps > 0' is 'true'

Fixes: 759619ae4437 ("rtc: rzn1: Add oscillator offset support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220520082500.489248-1-miquel.raynal@bootlin.com
drivers/rtc/rtc-rzn1.c