From 3619653fc6a2759bd90e725c760fd1a57030e396 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Thu, 5 Aug 2021 15:27:00 +1200 Subject: [PATCH] Fixed an error with the 32 bit time. The compiler was throwing an "right shift count >= width of type" error when yaffs was compiled using 32 bit time. This was fixed by replacing an if statement with a #define. Signed-off-by: Timothy Manning --- yaffs_guts.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yaffs_guts.c b/yaffs_guts.c index 41ceb5b..b83fa63 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4902,10 +4902,15 @@ static void yaffs_oh_time_load(u32 *yst_time, u32 *win_time, YTIME_T timeval) u32 lower; lower = timeval & 0xffffffff; - if (sizeof(YTIME_T) > sizeof(u32)) - upper = (timeval >> 32) & 0xffffffff; - else - upper = 0; + /* we have to use #defines here insted of an if statement + otherwise the compiler throws an error saying that + right shift count >= width of type when we are using 32 bit time. + */ + #ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T + upper = 0; + #else + upper = (timeval >> 32) & 0xffffffff; + #endif *yst_time = lower; win_time[0] = lower; -- 2.30.2