From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756361AbZCJOYh (ORCPT ); Tue, 10 Mar 2009 10:24:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755967AbZCJOY0 (ORCPT ); Tue, 10 Mar 2009 10:24:26 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:47227 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755560AbZCJOYZ (ORCPT ); Tue, 10 Mar 2009 10:24:25 -0400 Date: Tue, 10 Mar 2009 10:24:24 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ingo Molnar cc: prasad@linux.vnet.ibm.com, Andrew Morton , Linux Kernel Mailing List , Roland McGrath Subject: Re: [patch 00/11] Hardware Breakpoint interfaces In-Reply-To: <20090310135117.GC3850@elte.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Mar 2009, Ingo Molnar wrote: > > There's also a few checkpatch warnings that need to be > addressed: > > ERROR: do not use assignment in if condition > #1084: FILE: arch/x86/kernel/ptrace.c:581: > + else if ((thbi = alloc_thread_hw_breakpoint(tsk)) == > NULL) Changing this to remove the assignment from within the "if" condition would make the code less readable, not more. It's part of a long series of tests; in schematic form: if (n == 4 || n == 5) ... else if (n == 6) { ... } else if (!tsk->thread.hw_breakpoint_info && val == 0) ... else if ((thbi = alloc_thread_hw_breakpoint(tsk)) == NULL) ... else if (n < HB_NUM) { ... } else ... If you can suggest a way to change the code without making it worse, I'm sure Prasad will be happy to adopt it. Alan Stern