Re: [PATCH 1/1] fs: fat: convert change month correctly

2024-04-17 Thread Tom Rini
On Tue, 09 Apr 2024 20:04:56 +0200, Heinrich Schuchardt wrote:

> The month is stored in 5 - 8. We need to shift it by 5 bits.
> 
> Cf. Microsoft FAT Specification, 2005-08-30
> 
> 

Applied to u-boot/master, thanks!

-- 
Tom




Re: [PATCH 1/1] fs: fat: convert change month correctly

2024-04-11 Thread Ilias Apalodimas
On Tue, 9 Apr 2024 at 20:05, Heinrich Schuchardt
 wrote:
>
> 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 
> ---
>  fs/fat/fat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 14e53cf2d5a..2dd9d4e72dc 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;
> --
> 2.43.0
>

Reviewed-by: Ilias Apalodimas 


Re: [PATCH 1/1] fs: fat: convert change month correctly

2024-04-10 Thread Alexander Dahl
Hello Heinrich,

Am Tue, Apr 09, 2024 at 08:04:56PM +0200 schrieb Heinrich Schuchardt:
> 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 
> ---
>  fs/fat/fat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 14e53cf2d5a..2dd9d4e72dc 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;

Reviewed-by: Alexander Dahl 

Greets
Alex



[PATCH 1/1] fs: fat: convert change month correctly

2024-04-09 Thread Heinrich Schuchardt
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 
---
 fs/fat/fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 14e53cf2d5a..2dd9d4e72dc 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;
-- 
2.43.0