From patchwork Fri Feb 20 08:51:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 23475 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C2C11DDD0C for ; Fri, 20 Feb 2009 19:51:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbZBTIvk (ORCPT ); Fri, 20 Feb 2009 03:51:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753203AbZBTIvk (ORCPT ); Fri, 20 Feb 2009 03:51:40 -0500 Received: from mail-ew0-f21.google.com ([209.85.219.21]:38781 "EHLO mail-ew0-f21.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbZBTIvj (ORCPT ); Fri, 20 Feb 2009 03:51:39 -0500 Received: by ewy14 with SMTP id 14so744093ewy.13 for ; Fri, 20 Feb 2009 00:51:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=TEEcw1FlBVjVL8h0HwVegokQR5ekAsz4fu+EgPJzOe4=; b=eMgcNvhGgt28oHERwHCU/HpkNktqK1zvjqvVqvP88elUkzcV3MyenzAA+AuihudiO8 qg819ukRq4ZZN/8ijrY8srRZxu2QVsYW0ygVUT5CebixE1bChOfH9kqgnk895Ng2+FyH JoYfU7WaCgDnzu+XEV25CFTie8hChaO1kcnOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=fUgXsHZFqh3cN5wQJpllfWRRd0h3LwhZX+QjX/xMZMOsveOOgeRaxmU3DViPaMJBZU tYohMQAY1bKrW1qRZmGcOu8HFDvwJtn5y9lpIAs5MoKkHDdcAs9I9ZKG9wIlcfjuJGBf +tElS2iNtx7L17yYaLHaCaGIdVnm+3CsM7aN8= Received: by 10.210.18.8 with SMTP id 8mr443718ebr.183.1235119897851; Fri, 20 Feb 2009 00:51:37 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id h1sm2169348nfh.16.2009.02.20.00.51.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 20 Feb 2009 00:51:37 -0800 (PST) Message-ID: <499E6F18.4080503@gmail.com> Date: Fri, 20 Feb 2009 09:51:36 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: David Miller CC: steve.glendinning@smsc.com, netdev@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH] SMSC: timeout reaches -1 References: <49993E2D.4030103@gmail.com> <20090220.004114.239993457.davem@davemloft.net> In-Reply-To: <20090220.004114.239993457.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org David Miller wrote: > From: Roel Kluin > Date: Mon, 16 Feb 2009 11:21:33 +0100 > >> With a postfix decrement timeouts will reach -1 rather than 0, so >> the error path does not appear. >> >> Signed-off-by: Roel Kluin > > Steve Glendinning submitted the smsc9420 side of this patch, > please resubmit this with only the smsc911x.c part present. > > Thanks. > ok, here: --------------------------->8-------------8<------------------------------ With a postfix decrement timeouts will reach -1 rather than 0, so the error path does not appear. Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 783c1a7..9a78dae 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -1624,7 +1624,7 @@ static int smsc911x_eeprom_send_cmd(struct smsc911x_data *pdata, u32 op) do { msleep(1); e2cmd = smsc911x_reg_read(pdata, E2P_CMD); - } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--)); + } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout)); if (!timeout) { SMSC_TRACE(DRV, "TIMED OUT");