Received: from eggs.gnu.org ([2001:4830:134:3::10]:46404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEh0-0007Qf-8i for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:57:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoEgx-0001OQ-1N for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:57:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEgw-0001OE-Rm for qemu-devel@nongnu.org; Mon, 19 Oct 2015 13:57:50 -0400 Date: Mon, 19 Oct 2015 15:57:45 -0200 From: Eduardo Habkost Message-ID: <20151019175745.GC8672@thinpad.lan.raisama.net> References: <1445012619-23772-1-git-send-email-ehabkost@redhat.com> <1445012619-23772-7-git-send-email-ehabkost@redhat.com> <20151019173036.GB8672@thinpad.lan.raisama.net> <56252C8B.8050808@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56252C8B.8050808@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v2 6/9] target-i386: Handle I/O breakpoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Paolo Bonzini , qemu-devel@nongnu.org On Mon, Oct 19, 2015 at 07:46:51AM -1000, Richard Henderson wrote: > On 10/19/2015 07:30 AM, Eduardo Habkost wrote: > >>>+ /* Notice when we should enable calls to bpt_io. */ > >>>+ return (hw_breakpoint_enabled(env->dr[7], index) > >>>+ ? HF_IOBPT_MASK : 0); > >checkpatch.pl error: > > > > ERROR: return is not a function, parentheses are not required > > #57: FILE: target-i386/bpt_helper.c:69: > > + return (hw_breakpoint_enabled(env->dr[7], index) > > > > total: 1 errors, 0 warnings, 242 lines checked > > > >I will fix it in v3. > > In this case checkpatch is wrong, imo. The parenthesis are not there to > "make return a function", but to make the multi-line expression indent > properly. I understand if one thinks the expression looks better with the parenthesis, but I fail to see why they are needed to indent the expression properly. For reference, this is the change I have made in v3: diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c index 0fbdc03..dac1b1a 100644 --- a/target-i386/bpt_helper.c +++ b/target-i386/bpt_helper.c @@ -66,8 +66,8 @@ static int hw_breakpoint_insert(CPUX86State *env, int index) case DR7_TYPE_IO_RW: /* Notice when we should enable calls to bpt_io. */ - return (hw_breakpoint_enabled(env->dr[7], index) - ? HF_IOBPT_MASK : 0); + return hw_breakpoint_enabled(env->dr[7], index) + ? HF_IOBPT_MASK : 0; case DR7_TYPE_DATA_WR: if (hw_breakpoint_enabled(dr7, index)) { -- Eduardo