[PATCH v2 resend 0/2] x86/rtc: refactoring

From: Mateusz Jończyk
Date: Tue May 17 2022 - 16:22:21 EST


Hello,

The first and main patch of this series removes duplicated code in
mach_get_cmos_time() in arch/x86/kernel/rtc.c . This function performed
the same thing as mc146818_get_time() - reading the time from the CMOS
RTC - but used a different algorithm. So modify it to use common
mc146818_get_time().

The second patch renames a function in arch/x86/kernel/rtc.c.

Tested originally (on top of 5.18-rc3) on 3 computers, and in i386 and
amd64 VMs.

Greetings,
Mateusz

v2:
- drop the previously first patch ("rtc-mc146818-lib: reduce RTC_UIP
polling period"). Its intent was to make behaviour of
mc146818_get_time() more similar to the existing version of
mach_get_cmos_time() by decreasing the polling period in
mc146818_get_time(). However, I determined that this does not matter
for users of mach_get_cmos_time().

- use pr_err instead of pr_err_ratelimited in the first remaining
patch,

- small patch description modifications.

Signed-off-by: Mateusz Jończyk <mat.jonczyk@xxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Mateusz Jończyk (2):
x86/rtc: rewrite mach_get_cmos_time to delete duplicated code
x86/rtc: rename mach_set_rtc_mmss

arch/x86/include/asm/mc146818rtc.h | 2 +-
arch/x86/kernel/rtc.c | 63 +++++-------------------------
arch/x86/kernel/x86_init.c | 2 +-
3 files changed, 11 insertions(+), 56 deletions(-)


base-commit: 42226c989789d8da4af1de0c31070c96726d990c
--
2.25.1