>>> Index: qemu-dgibson-for-2.6.git/hw/ppc/spapr_hcall.c >>> =================================================================== >>> --- qemu-dgibson-for-2.6.git.orig/hw/ppc/spapr_hcall.c >>> +++ qemu-dgibson-for-2.6.git/hw/ppc/spapr_hcall.c >>> @@ -835,17 +835,8 @@ static target_ulong h_set_mode_resource_ >>> return H_P4; >>> } >>> >>> - switch (mflags) { >>> - case H_SET_MODE_ADDR_TRANS_NONE: >>> - prefix = 0; >>> - break; >>> - case H_SET_MODE_ADDR_TRANS_0001_8000: >>> - prefix = 0x18000; >>> - break; >>> - case H_SET_MODE_ADDR_TRANS_C000_0000_0000_4000: >>> - prefix = 0xC000000000004000ULL; >>> - break; >>> - default: >>> + prefix = cpu_ppc_get_excp_prefix(mflags); >>> + if (prefix == (target_ulong) -1ULL) { >> >> + if (prefix == (target_ulong) (-1ULL)) { >> >> to make ./scripts/checkpatch.pl happy :) > > yes. > > The funny thing is that checkpatch.pl does not complain for the exact > same line below. Looks like a checkpatch.pl bug to me.
Well, the reason is that a new possible type 'target_ulong' is caught a little late in the checkpatch process and this is why the script complains at the first occurrence. Pointer casts are caught early but not casts, probably because this is too complex to catch with a regex. So the easy fix would be to add 'target_ulong' in the @typeList array. This seems reasonable enough as 'target_ulong' is a common qemu type. C.