From 6e68ee347555b1b37b42195210b138a105387f01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mateusz=20Jo=C5=84czyk?= Date: Sun, 13 Jul 2025 12:04:33 +0200 Subject: [PATCH] mips: remove redundant macro mc146818_decode_year MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The mc146818_decode_year macro is used only in mc146818_get_cmos_time(), which in turn is called only in arch/mips/loongson2ef/common/time.c and arch/mips/mti-malta/malta-time.c so on mach-jazz it is unused and can be removed. On other platforms it is defined in the same way, so it can be safely folded into mc146818_get_cmos_time(). Signed-off-by: Mateusz Jończyk Signed-off-by: Thomas Bogendoerfer --- arch/mips/include/asm/mach-generic/mc146818rtc.h | 4 ---- arch/mips/include/asm/mach-jazz/mc146818rtc.h | 2 -- arch/mips/include/asm/mach-malta/mc146818rtc.h | 2 -- arch/mips/include/asm/mc146818-time.h | 5 ++++- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/mips/include/asm/mach-generic/mc146818rtc.h b/arch/mips/include/asm/mach-generic/mc146818rtc.h index 9c72e540ff561..249279b0494d3 100644 --- a/arch/mips/include/asm/mach-generic/mc146818rtc.h +++ b/arch/mips/include/asm/mach-generic/mc146818rtc.h @@ -29,8 +29,4 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr) #define RTC_ALWAYS_BCD 0 -#ifndef mc146818_decode_year -#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) -#endif - #endif /* __ASM_MACH_GENERIC_MC146818RTC_H */ diff --git a/arch/mips/include/asm/mach-jazz/mc146818rtc.h b/arch/mips/include/asm/mach-jazz/mc146818rtc.h index 987f727afe25e..639bff8ebca39 100644 --- a/arch/mips/include/asm/mach-jazz/mc146818rtc.h +++ b/arch/mips/include/asm/mach-jazz/mc146818rtc.h @@ -33,6 +33,4 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr) #define RTC_ALWAYS_BCD 0 -#define mc146818_decode_year(year) ((year) + 1980) - #endif /* __ASM_MACH_JAZZ_MC146818RTC_H */ diff --git a/arch/mips/include/asm/mach-malta/mc146818rtc.h b/arch/mips/include/asm/mach-malta/mc146818rtc.h index e8cc7fdf74157..7da2c0ea55da5 100644 --- a/arch/mips/include/asm/mach-malta/mc146818rtc.h +++ b/arch/mips/include/asm/mach-malta/mc146818rtc.h @@ -31,6 +31,4 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr) #define RTC_ALWAYS_BCD 0 -#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) - #endif /* __ASM_MACH_MALTA_MC146818RTC_H */ diff --git a/arch/mips/include/asm/mc146818-time.h b/arch/mips/include/asm/mc146818-time.h index 07bf30bee7921..4e07914e94e69 100644 --- a/arch/mips/include/asm/mc146818-time.h +++ b/arch/mips/include/asm/mc146818-time.h @@ -37,7 +37,10 @@ static inline time64_t mc146818_get_cmos_time(void) year = bcd2bin(year); } spin_unlock_irqrestore(&rtc_lock, flags); - year = mc146818_decode_year(year); + if (year < 70) + year += 2000; + else + year += 1900; return mktime64(year, mon, day, hour, min, sec); } -- 2.47.3