mips: remove redundant macro mc146818_decode_year

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 <mat.jonczyk@o2.pl>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
Mateusz Jończyk
2025-07-16 18:47:08 +02:00
committed by Thomas Bogendoerfer
parent 3b3c4f9140
commit 6e68ee3475
4 changed files with 4 additions and 9 deletions
@@ -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 */
@@ -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 */
@@ -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 */
+4 -1
View File
@@ -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);
}