diff options
author | Amelie Delaunay <amelie.delaunay@st.com> | 2017-01-16 13:08:53 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-01-23 02:47:15 +0300 |
commit | 1d70ba3bfb30cf8d151f18f5bf7d7a218ecede57 (patch) | |
tree | cef5a5b02f011e0206654f8e029de50c145f7ffc /Documentation/xillybus.txt | |
parent | a560c527638d78bc05d06585fef2d94b22b727b8 (diff) | |
download | linux-1d70ba3bfb30cf8d151f18f5bf7d7a218ecede57.tar.xz |
rtc: stm32: fix comparison warnings
This patches fixes comparison between signed and unsigned values as it
could produce an incorrect result when the signed value is converted to
unsigned:
drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_valid_alrm':
drivers/rtc/rtc-stm32.c:404:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((((tm->tm_year > cur_year) &&
...
It also fixes comparison always true or false due to the fact that unsigned
value is compared against zero with >= or <:
drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_init':
drivers/rtc/rtc-stm32.c:514:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
for (pred_a = pred_a_max; pred_a >= 0; pred_a-- ) {
drivers/rtc/rtc-stm32.c:530:44: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
(rate - ((pred_a + 1) * (pred_s + 1)) < 0) ?
Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver")
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'Documentation/xillybus.txt')
0 files changed, 0 insertions, 0 deletions