From 2314f3c08fc8ebe6e9078a6d65a5d8686bb884d0 Mon Sep 17 00:00:00 2001 From: Matthieu CASTET Date: Mon, 7 Jun 2021 18:45:07 +0200 Subject: [PATCH] exfat: fix build on old 32 bits system For kernel less than 4.19.0, the max supported date is 2038 for 32/64 bits. This should fix : In file included from fs/exfat/misc.c:14: fs/exfat/misc.c: In function 'exfat_set_entry_time': fs/exfat/exfat_raw.h:166:37: error: overflow in conversion from 'long long int' to '__kernel_time_t' {aka 'long int'} changes value from '4354819199' to '59851903' [-Werror=overflow] 166 | #define EXFAT_MAX_TIMESTAMP_SECS 4354819199LL | ^~~~~~~~~~~~ fs/exfat/misc.c:135:16: note: in expansion of macro 'EXFAT_MAX_TIMESTAMP_SECS' 135 | ts->tv_sec = EXFAT_MAX_TIMESTAMP_SECS; | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors scripts/Makefile.build:258: recipe for target 'fs/exfat/misc.o' failed Signed-off-by: Matthieu CASTET Signed-off-by: Namjae Jeon --- misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc.c b/misc.c index b9fed54901d1..9d81e803c442 100644 --- a/misc.c +++ b/misc.c @@ -119,6 +119,8 @@ void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec *ts, void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts, u8 *tz, __le16 *time, __le16 *date, u8 *time_cs) #else +#undef EXFAT_MAX_TIMESTAMP_SECS +#define EXFAT_MAX_TIMESTAMP_SECS 0xffffffff void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec *ts, u8 *tz, __le16 *time, __le16 *date, u8 *time_cs) #endif