[PATCH 1/1] fs: fat: fix seconds in timestamp

Simon Glass sjg at chromium.org
Wed May 20 22:42:30 CEST 2026


On 2026-05-16T18:37:00, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
> fs: fat: fix seconds in timestamp
>
> The FAT time format stores seconds/2 in bits 4:0. The expression
> 'tm.tm_sec > 1' is a boolean comparison (yields 0 or 1) where a
> right-shift 'tm.tm_sec >> 1' was intended.  As a result every
> file timestamp written by U-Boot has its seconds field set to
> either 0 or 1, depending on whether tm_sec is greater than 1.
>
> Also fix the indentation of the tm_hour line.
>
> Fixes: ba23c378c544 ("fs: fat: fill creation and change date")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>
> fs/fat/fat_write.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list