All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: limit reaches -1, tested 0
@ 2009-01-31 11:33 Roel Kluin
  0 siblings, 0 replies; 14+ messages in thread
From: Roel Kluin @ 2009-01-31 11:33 UTC (permalink / raw)
  To: dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

With a postfix decrement limit will reach -1 rather than 0,
so the warning will not be issued.

Signed-off-by: Roel Kluin <roel.kluin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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,

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] spi: limit reaches -1, tested 0
@ 2009-02-08 14:18 Roel Kluin
       [not found] ` <498EE9C0.3010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Roel Kluin @ 2009-02-08 14:18 UTC (permalink / raw)
  To: dbrownell; +Cc: spi-devel-general, lkml

With a postfix decrement limit will reach -1 rather than 0,
so the warning will not be issued.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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,

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-02-08 17:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 11:33 [PATCH] spi: limit reaches -1, tested 0 Roel Kluin
  -- strict thread matches above, loose matches on Subject: below --
2009-02-08 14:18 Roel Kluin
     [not found] ` <498EE9C0.3010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 15:55   ` David Brownell
2009-02-08 15:55     ` David Brownell
     [not found]     ` <200902080755.26241.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-08 16:28       ` David Brownell
2009-02-08 16:28         ` David Brownell
     [not found]         ` <200902080828.49036.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-08 16:50           ` Roel Kluin
2009-02-08 16:50             ` Roel Kluin
     [not found]             ` <498F0D64.4040909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 17:26               ` David Brownell
2009-02-08 17:26                 ` David Brownell
2009-02-08 17:42               ` Mariusz Ceier
2009-02-08 17:42                 ` Mariusz Ceier
     [not found]                 ` <498F1979.1030104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 17:46                   ` Roel Kluin
2009-02-08 17:46                     ` Roel Kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.