Skip to content

Commit

Permalink
rtc: mc146818-lib: fix signedness bug in mc146818_get_time()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Reviewed-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220111071922.GE11243@kili
  • Loading branch information
Dan Carpenter authored and Alexandre Belloni committed Jan 16, 2022
1 parent a12ac1f commit 7372971
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-mc146818-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static void mc146818_get_time_callback(unsigned char seconds, void *param_in)
p->ctrl = CMOS_READ(RTC_CONTROL);
}

unsigned int mc146818_get_time(struct rtc_time *time)
int mc146818_get_time(struct rtc_time *time)
{
struct mc146818_get_time_callback_param p = {
.time = time
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct cmos_rtc_board_info {
#endif /* ARCH_RTC_LOCATION */

bool mc146818_does_rtc_work(void);
unsigned int mc146818_get_time(struct rtc_time *time);
int mc146818_get_time(struct rtc_time *time);
int mc146818_set_time(struct rtc_time *time);

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

0 comments on commit 7372971

Please sign in to comment.