Skip to content

Commit 7372971

Browse files
Dan Carpenteralexandrebelloni
authored andcommitted
rtc: mc146818-lib: fix signedness bug in mc146818_get_time()
The mc146818_get_time() function returns zero on success or negative a error code on failure. It needs to be type int. Fixes: d35786b ("rtc: mc146818-lib: change return values of mc146818_get_time()") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Mateusz Jończyk <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/20220111071922.GE11243@kili
1 parent a12ac1f commit 7372971

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/rtc/rtc-mc146818-lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void mc146818_get_time_callback(unsigned char seconds, void *param_in)
130130
p->ctrl = CMOS_READ(RTC_CONTROL);
131131
}
132132

133-
unsigned int mc146818_get_time(struct rtc_time *time)
133+
int mc146818_get_time(struct rtc_time *time)
134134
{
135135
struct mc146818_get_time_callback_param p = {
136136
.time = time

include/linux/mc146818rtc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct cmos_rtc_board_info {
124124
#endif /* ARCH_RTC_LOCATION */
125125

126126
bool mc146818_does_rtc_work(void);
127-
unsigned int mc146818_get_time(struct rtc_time *time);
127+
int mc146818_get_time(struct rtc_time *time);
128128
int mc146818_set_time(struct rtc_time *time);
129129

130130
bool mc146818_avoid_UIP(void (*callback)(unsigned char seconds, void *param),

0 commit comments

Comments
 (0)