[PATCH] mtd: mtdpart: use uint64_t instead of int for cur_off

Heiko Schocher hs at denx.de
Fri Jul 17 06:00:36 CEST 2020

Hello Martin,

Am 13.07.2020 um 14:40 schrieb Martin Kaistra:
> The types of "offset" and "size" of "struct mtd_partition" are uint64_t,
> while mtd_parse_partitions() uses int to work with these values. When
> the offset reaches 2GB, it is interpreted as a negative value, which
> leads to error messages like
> mtd: partition "<partition name>" is out of reach -- disabled
> eg. when using the "ubi part" command.
> Fix this by using uint64_t for cur_off and cur_sz.
> Signed-off-by: Martin Kaistra <martin.kaistra at linutronix.de>
> Reviewed-by: Kurt Kanzenbach <kurt at linutronix.de>
> ---
>   drivers/mtd/mtdpart.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Heiko Schocher <hs at denx.de>

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

More information about the U-Boot mailing list