Re: [PATCH v3] mtd: ubi: fix NVMEM over UBI volumes on 32-bit systems

From: Randy Dunlap
Date: Thu Feb 29 2024 - 01:01:30 EST




On 2/28/24 19:47, Daniel Golle wrote:
> A compiler warning related to sizeof(int) != 8 when calling do_div()
> is triggered when building on 32-bit platforms.
> Address this by using integer types having a well-defined size.
>
> Fixes: 3ce485803da1 ("mtd: ubi: provide NVMEM layer over UBI volumes")
> Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
> ---
> v3: use size_t also for 'to_read' variable to avoid truncation
> (no problem in practise beyond the compiler warning)
> v2: use size_t for 'bytes_left' variable to match parameter type
>
> drivers/mtd/ubi/nvmem.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>

Works for me. Thanks.

Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

--
#Randy