Skip to content
Commit f3606687 authored by Colin Ian King's avatar Colin Ian King Committed by Alexandre Belloni
Browse files

rtc: msc313: Fix unintentional sign extension issues with left shift of a u16



Shifting the u16 value returned by readw by 16 bits to the left
will be promoted to a 32 bit signed int and then sign-extended
to an unsigned long. If the top bit of the readw is set then
the shifted value will be sign extended and the top 32 bits of
the result will be set.

Fixes: be7d9c91 ("rtc: Add support for the MSTAR MSC313 RTC")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210928134654.991923-1-colin.king@canonical.com
parent 3109151c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment