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

Randy Dunlap rdunlap at infradead.org
Wed Feb 28 22:01:16 PST 2024



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 at makrotopia.org>
> ---
> 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 at infradead.org>

-- 
#Randy



More information about the linux-mtd mailing list