]> git.dujemihanovic.xyz Git - u-boot.git/commit
mtd: mtdpart: use uint64_t instead of int for cur_off
authorMartin Kaistra <martin.kaistra@linutronix.de>
Mon, 13 Jul 2020 12:40:02 +0000 (14:40 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 17 Jul 2020 14:47:19 +0000 (10:47 -0400)
commit892d4617357db355bf847ca37dd76cf946727ec2
tree28e243f736ef16c7ccbd3019be79725110c79a54
parentb72bbf575b02f1845e1088d1c98390748fc51944
mtd: mtdpart: use uint64_t instead of int for cur_off

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@linutronix.de>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/mtd/mtdpart.c