On 4 June 2018 at 16:09, Alex Bennée <alex.ben...@linaro.org> wrote: > > Peter Maydell <peter.mayd...@linaro.org> writes: > >> On 23 May 2018 at 10:08, Alex Bennée <alex.ben...@linaro.org> wrote: >>> Its a minor thing but are we ever expecting iommu_idx to ever be >>> negative? >> >> Coming back to this one -- no, we don't expect negative iommu_idxs. >> But on the other hand we don't ever expect negative TCG mmu_indexes >> either, and we use 'int' for those... > > That's a clean-up right there ;-) > > As I said it's a minor thing but I generally favour clearest type for > the range you are going to see. That said the enum stuff on the older > clangs did confuse me so there is that...
I prefer the "don't use unsigned unless you need the unsigned-integer semantics" approach. (For instance most loop indexes won't ever be negative, but "int i" is the usual thing there.) thanks -- PMM