Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbbLMP3K (ORCPT ); Sun, 13 Dec 2015 10:29:10 -0500 Received: from netrider.rowland.org ([192.131.102.5]:49144 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751924AbbLMP3I (ORCPT ); Sun, 13 Dec 2015 10:29:08 -0500 Date: Sun, 13 Dec 2015 10:29:07 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Geyslan G. Bem" cc: peter.senna@gmail.com, , , Greg Kroah-Hartman Subject: Re: [PATCH v2 01/10] usb: host: ehci-sched: refactor scan_isoc function In-Reply-To: <1449979438-12038-2-git-send-email-geyslan@gmail.com> 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 Content-Length: 927 Lines: 25 On Sun, 13 Dec 2015, Geyslan G. Bem wrote: > This patch removes an infinite 'for' loop and makes use of the already > existing 'restart' tag instead, reducing one leading tab. > > It also puts the easier evaluation (live variable) to be the first in > two conditionals. > > if (live && frame == now_frame) { ... > > if (live && ((frame == now_frame) || ... You should never do this. The first test in a conditional should be the one that is most likely to cause the expression to fail. In this case, live is almost always true whereas frame == now_frame is true only some percentage of the time. Therefore the frame == now_frame test should come first. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/