From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alZ1d-00067T-Hr for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alZ1a-0000YA-CL for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:25 -0400 Received: from e06smtp05.uk.ibm.com ([195.75.94.101]:58355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alZ1a-0000Y4-1E for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:22 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Mar 2016 10:36:19 +0100 References: <1459352314-12552-1-git-send-email-clg@fr.ibm.com> <20160330191222.75dc8364@bahia.huguette.org> <56FCDDC9.3080109@fr.ibm.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <56FCEF04.6070708@fr.ibm.com> Date: Thu, 31 Mar 2016 11:33:56 +0200 MIME-Version: 1.0 In-Reply-To: <56FCDDC9.3080109@fr.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] spapr: compute interrupt vector address from LPCR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Thomas Huth , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson >>> 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.