diff mbox

[U-Boot,3/3] tegra: usb: fix wrong error check

Message ID 1338328033-8597-3-git-send-email-dev@lynxeye.de
State Accepted
Commit f857fff6068fe36a327a0ff6d837412caaf2e07d
Headers show

Commit Message

Lucas Stach May 29, 2012, 9:47 p.m. UTC
Just stumbled upon this, while looking through the usb code. loop_count
runs down from 10000, so the correct condition to error out is ==0.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Tom Warren <twarren.nvidia@gmail.com>
---
 arch/arm/cpu/armv7/tegra2/usb.c |    2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Comments

Stephen Warren May 29, 2012, 10:18 p.m. UTC | #1
On 05/29/2012 03:47 PM, Lucas Stach wrote:
> Just stumbled upon this, while looking through the usb code. loop_count
> runs down from 10000, so the correct condition to error out is ==0.

The code change is probably fine, but it'd be better if the commit
description stated just what was being changed and why, rather than
being conversational.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tom Warren May 29, 2012, 11:20 p.m. UTC | #2
Lucas,

On Tue, May 29, 2012 at 3:18 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 05/29/2012 03:47 PM, Lucas Stach wrote:
>> Just stumbled upon this, while looking through the usb code. loop_count
>> runs down from 10000, so the correct condition to error out is ==0.
>
> The code change is probably fine, but it'd be better if the commit
> description stated just what was being changed and why, rather than
> being conversational.
>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>

In addition, I'd like to see come comment in the commit msg about what
HW this was tested on, what was done to test it, etc.

Tom
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/tegra2/usb.c b/arch/arm/cpu/armv7/tegra2/usb.c
index c80de7f..5f2b243 100644
--- a/arch/arm/cpu/armv7/tegra2/usb.c
+++ b/arch/arm/cpu/armv7/tegra2/usb.c
@@ -290,7 +290,7 @@  static int init_usb_controller(struct fdt_usb *config,
 			break;
 		udelay(1);
 	}
-	if (loop_count == 100000)
+	if (!loop_count)
 		return -1;
 
 	return 0;