From: David Brownell Subject: Re: [PATCH] spi: limit reaches -1, tested 0 Date: Sun, 8 Feb 2009 07:55:26 -0800 Message-ID: <200902080755.26241.david-b@pacbell.net> References: <498EE9C0.3010601@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Andrew Morton , lkml To: Roel Kluin Return-path: In-Reply-To: <498EE9C0.3010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Sunday 08 February 2009, Roel Kluin wrote: > With a postfix decrement limit will reach -1 rather than 0, > so the warning will not be issued. > > Signed-off-by: Roel Kluin Acked-by: David Brownell > --- > diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c > index 269a55e..a4652f1 100644 > --- a/drivers/spi/spi_imx.c > +++ b/drivers/spi/spi_imx.c > @@ -779,7 +779,7 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data) > > /* Read trailing bytes */ > limit = loops_per_jiffy << 1; > - while ((read(drv_data) == 0) && limit--); > + while ((read(drv_data) == 0) && --limit); > > if (limit == 0) > dev_err(&drv_data->pdev->dev, > > ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com