From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwB88-0000rA-Kg for qemu-devel@nongnu.org; Sat, 11 Feb 2012 06:28:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwB87-00013B-73 for qemu-devel@nongnu.org; Sat, 11 Feb 2012 06:28:36 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59885 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwB86-000131-So for qemu-devel@nongnu.org; Sat, 11 Feb 2012 06:28:35 -0500 Message-ID: <4F3650E0.6070400@suse.de> Date: Sat, 11 Feb 2012 12:28:32 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <4F33E6B1.4090901@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [BUG] checkpatch: ERROR due to * recognized as operator List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Peter Maydell , qemu-devel Developers , Alexander Graf Am 11.02.2012 10:26, schrieb Blue Swirl: > On Thu, Feb 9, 2012 at 15:30, Andreas F=C3=A4rber wr= ote: >> Hello Blue, >> >> I recently stumbled over the following checkpatch.pl false positive: >> >> --8<-- >> >> --- a/hw/his.c >> +++ b/hw/his.c >> @@ -1,1 +1,1 @@ >> - cpu_reset(CPUState *env); >> + cpu_state_reset(CPUState *env); >> >> --- a/hw/hers.c >> +++ b/hw/hers.c >> @@ -1,1 +1,1 @@ >> - cpu_reset(CPUX86State *env); >> + cpu_state_reset(CPUX86State *env); >> >> --- a/hw/its.c >> +++ b/hw/its.c >> @@ -1,1 +1,1 @@ >> -cpu_reset(CPUState *env); >> +cpu_state_reset(CPUState *env); >> >> --- a/hw/theirs.c >> +++ b/hw/theirs.c >> @@ -1,2 +1,2 @@ >> typedef struct CPUState CPUState; >> -cpu_reset(CPUState *env); >> +cpu_state_reset(CPUState *env); >> >> --8<-- >> >> results in: >> >> >> ERROR: need consistent spacing around '*' (ctx:WxV) >> #5: FILE: hw/his.c:1: >> + cpu_state_reset(CPUState *env); >> ^ >> >> ERROR: need consistent spacing around '*' (ctx:WxV) >> #11: FILE: hw/hers.c:1: >> + cpu_state_reset(CPUX86State *env); >> ^ >> >> ERROR: need consistent spacing around '*' (ctx:WxV) >> #17: FILE: hw/its.c:1: >> +cpu_state_reset(CPUState *env); >> ^ >> >> ERROR: need consistent spacing around '*' (ctx:WxV) >> #24: FILE: hw/theirs.c:2: >> +cpu_state_reset(CPUState *env); >> ^ >> >> total: 4 errors, 0 warnings, 9 lines checked >> >> >> So, it seems to interpret the * symbol as multiplication rather than >> pointer. >> >> Surprisingly, in my real code, using CPUState in place of CPUX86State >> was actually able to remedy the ERROR but not in this simplified test >> case. I added some prints around that place and it seems, in the worki= ng >> CPUState case it didn't even enter the op checking code path. >> >> Any ideas? >=20 > IIRC Linux does not use typedefs much, so maybe typedefs combined with > #defines confuse checkpatch.pl. >=20 > But I don't know why this case would be different to: > typedef long long int64_t; > #define off_t int64_t > void func(off_t *e); I don't think typedefs matter but there was a specific regex for *_t. Andreas >=20 > Perhaps using a typedef in place of #define could help but I'd not > make such a change just to silence checkpatch. >=20 >> >> Regards, >> Andreas >> >> -- >> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany >> GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg