]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mips: remove redundant macro mc146818_decode_year
authorMateusz Jończyk <mat.jonczyk@o2.pl>
Sun, 13 Jul 2025 10:04:33 +0000 (12:04 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 16 Jul 2025 16:47:08 +0000 (18:47 +0200)
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>
arch/mips/include/asm/mach-generic/mc146818rtc.h
arch/mips/include/asm/mach-jazz/mc146818rtc.h
arch/mips/include/asm/mach-malta/mc146818rtc.h
arch/mips/include/asm/mc146818-time.h

index 9c72e540ff5615744c293010b39cf527006914f6..249279b0494d3028dd6018229194035bc15d1964 100644 (file)
@@ -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 */
index 987f727afe25e1d5638b479e963e906669a5bd05..639bff8ebca39ec30b7de5b84bb6954cf457542a 100644 (file)
@@ -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 */
index e8cc7fdf74157549066cebbc83f9834644dbc870..7da2c0ea55da574693e26002d1f48a20429482e2 100644 (file)
@@ -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 */
index 07bf30bee792102df548ba2c8bbc629fa0a47033..4e07914e94e69ce4e1752152ee30ed33b8d1b1c5 100644 (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);
 }