write_buff() uses ~(flash_info.portwidth - 1) to mask lower bits of addr. This causes higher 32 bits of addr to be discarded on a 64 bit system, since flash_info.portwidth is 32 bits long (unsigned int) and addr is 64 bits long (unsigned long). Signed-off-by: Peter Mamonov <pmamonov@xxxxxxxxx> --- drivers/mtd/nor/cfi_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c index 5bdcccae1..01ab1aa27 100644 --- a/drivers/mtd/nor/cfi_flash.c +++ b/drivers/mtd/nor/cfi_flash.c @@ -515,7 +515,7 @@ static int write_buff(struct flash_info *info, const u8 *src, int buffered_size; #endif /* get lower aligned address */ - wp = addr & ~(info->portwidth - 1); + wp = addr & ~((unsigned long)info->portwidth - 1); /* handle unaligned start */ aln = addr - wp; -- 2.17.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox