On 5/19/21 6:32 PM, Mike Frysinger wrote: > On 19 May 2021 12:46, Tom de Vries wrote: >> --- a/sim/ppc/hw_memory.c >> +++ b/sim/ppc/hw_memory.c >> @@ -190,7 +190,7 @@ hw_memory_init_address(device *me) >> if (device_find_property(me, "available") != NULL) { >> hw_memory_chunk **curr_chunk = &hw_memory->heap; >> int cell_nr; >> - unsigned_cell dummy; >> + signed_cell dummy; >> int nr_cells = device_find_integer_array_property(me, "available", 0, &dummy); > > this one is fine > >> @@ -199,9 +199,9 @@ hw_memory_init_address(device *me) >> cell_nr += 2) { >> hw_memory_chunk *new_chunk = ZALLOC(hw_memory_chunk); >> device_find_integer_array_property(me, "available", cell_nr, >> - &new_chunk->address); >> + (signed_cell *)&new_chunk->address); >> device_find_integer_array_property(me, "available", cell_nr + 1, >> - &new_chunk->size); >> + (signed_cell *)&new_chunk->size); >> >> --- a/sim/ppc/hw_opic.c >> +++ b/sim/ppc/hw_opic.c >> @@ -417,10 +417,12 @@ hw_opic_init_data(device *me) >> } >> if (!device_find_integer_array_property(me, "interrupt-ranges", >> reg_nr * 2, >> - &opic->isu_block[isb].int_number) >> + (signed_cell *) >> + &opic->isu_block[isb].int_number) >> || !device_find_integer_array_property(me, "interrupt-ranges", >> reg_nr * 2 + 1, >> - &opic->isu_block[isb].range)) >> + (signed_cell *) >> + &opic->isu_block[isb].range)) > > these ones i'm not sure about. it does fix the warnings, and it doesn't > change the status quo behavior, but i don't think it's the actual fix we > would want. if the device tree has a negative number, it'll get converted > to an unsigned number. i haven't thought hard as to what the right fix > would look like here. > > i think we'd have to look at what other device tree users are doing like > in boot loaders (e.g. u-boot) and in the linux kernel. Ack. That's out of scope for me though, so I'm gonna carry this updated patch locally, and if not fixed otherwise, this'll end up in the openSUSE gdb package. Thanks, - Tom