aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-04-09 20:04:56 +0200
committerTom Rini <trini@konsulko.com>2024-04-17 17:06:04 -0600
commit3c1bc9f15c18149a26fbd7f604f76f949a29bc7d (patch)
tree83f2cafddff9f29715eae9c5128ca4a192ddb53d /fs
parent7c665e151246cf8b5072ca4f1916f8ed0fa8565c (diff)
downloadu-boot-3c1bc9f15c18149a26fbd7f604f76f949a29bc7d.zip
u-boot-3c1bc9f15c18149a26fbd7f604f76f949a29bc7d.tar.gz
u-boot-3c1bc9f15c18149a26fbd7f604f76f949a29bc7d.tar.bz2
fs: fat: convert change month correctly
The month is stored in 5 - 8. We need to shift it by 5 bits. Cf. Microsoft FAT Specification, 2005-08-30 Fixes: 13c11c665320 ("fs: fat: add file attributes to struct fs_dirent") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alexander Dahl <ada@thorsis.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 14e53cf..2dd9d4e 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1254,7 +1254,7 @@ out:
static void __maybe_unused fat2rtc(u16 date, u16 time, struct rtc_time *tm)
{
tm->tm_mday = date & 0x1f;
- tm->tm_mon = (date & 0x1e0) >> 4;
+ tm->tm_mon = (date & 0x1e0) >> 5;
tm->tm_year = (date >> 9) + 1980;
tm->tm_sec = (time & 0x1f) << 1;